From unknown Sat Aug 16 16:00:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#20427: bug in optimizing compiler? Resent-From: Rafael D Sorkin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Apr 2015 04:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20427 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 20427@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Reply-To: Rafael D Sorkin Received: via spool by submit@debbugs.gnu.org id=B.143002176625548 (code B ref -1); Sun, 26 Apr 2015 04:17:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Apr 2015 04:16:06 +0000 Received: from localhost ([127.0.0.1]:40090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmDzB-0006dg-Q4 for submit@debbugs.gnu.org; Sun, 26 Apr 2015 00:16:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59974) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmDzA-0006WL-Fo for submit@debbugs.gnu.org; Sun, 26 Apr 2015 00:16:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmDz4-00019l-61 for submit@debbugs.gnu.org; Sun, 26 Apr 2015 00:15:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmDz4-00019U-1n for submit@debbugs.gnu.org; Sun, 26 Apr 2015 00:15:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmDz2-0001Li-Tw for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 00:15:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmDyz-000178-OS for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 00:15:56 -0400 Received: from mail-qg0-f100.google.com ([209.85.192.100]:36673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmDyz-000171-Kz for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 00:15:53 -0400 Received: by qgdz60 with SMTP id z60so2892098qgd.3 for ; Sat, 25 Apr 2015 21:15:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:reply-to:from:to:subject:message-id:date; bh=MWH7gdUT6atWdoTvVvr5VistfPRAXI8UCUzfbu5ZVsY=; b=PDkrwaTXjPaMiqkjk5mOoAhe2F16pZd3ZIR1AYN/Oketw96F5jMRVrm9g3IKAN38c/ MMNSrQfUMx0BjrQ7cQ3jF5DpicNu5Tb7+gdn7GgTf+KZ1f58OEbPO/atCtCh2sLOY4BI J/9uw2sJ1J7invZ5/i7aOxI872TteumJN0UDOScp6+hDuWOf+ogTks3tRRnqPfhDLNxQ 4N5IGxfSOQf4uN+QZNoNJBGcf7bWxTZml6txiGgOCEzXL5A3Vyfu6AoRqrA/qiPrXtkq 8gP8pxufO8LBiLcA5F3OW/i/wAnbGelb1fdy/iCoLIaeclhf0xVbpz95F/58SmEPhCmo hPTw== X-Gm-Message-State: ALoCoQlMzBx9IcgKjuA5M2TGcoiD/+/U68Z1vfGHugWHwCMpmQ/UGxYSg235j/JWjCYB6PibwmGkSFd89Q5K3t+OSssxjChtkw== X-Received: by 10.50.119.101 with SMTP id kt5mr2793979igb.49.1430021752204; Sat, 25 Apr 2015 21:15:52 -0700 (PDT) Received: from mail2.pi.local (nat.perimeterinstitute.ca. [107.6.61.163]) by mx.google.com with ESMTP id ee9sm361618igb.4.2015.04.25.21.15.51; Sat, 25 Apr 2015 21:15:52 -0700 (PDT) X-Relaying-Domain: perimeterinstitute.ca Received: from mars.pi.local (mars.pi.local [10.10.7.6]) by mail2.pi.local (Postfix) with ESMTPS id 93890C0964; Sat, 25 Apr 2015 22:06:37 -0500 (CDT) Received: from rsorkin by mars.pi.local with local (Exim 4.69) (envelope-from ) id 1YmDyx-0003q2-LQ; Sun, 26 Apr 2015 00:15:51 -0400 From: Rafael D Sorkin Message-Id: Date: Sun, 26 Apr 2015 00:15:51 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) The following report refers to this version of emacs: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian Hello, When I byte-compile a file containing the following code, with optimization safety=0, the compiler deletes the assertion test. (defmacro buggy () (assert nil nil "assertion failed -- it always should fail") "This should never show up!") This only seems to happen when i compile a file containing the macro, not when i compile the macro individually. Here is a full example (the defmacro of `buggy' is in the file "bug.test.el") (declaim (optimize (safety 3))) (byte-compile-file "bug.test.el" 'load) ; t (buggy) ; error: "assertion failed -- it always should fail" (declaim (optimize (safety 0))) (byte-compile-file "bug.test.el" 'load) ; t (buggy) ; This should never show up! I'm not sure whether this officially qualifies as a bug, but it's certainly not the behavior I was expecting. (It also doesn't seem to be present in Emacs 23.1.1) Thanks, Rafael ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- Rafael Sorkin Perimeter Institute for Theoretical Physics 31 Caroline Street North Waterloo, ON N2L 2Y5 Canada ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 27 00:04:13 2015 Received: (at control) by debbugs.gnu.org; 27 Apr 2015 04:04:13 +0000 Received: from localhost ([127.0.0.1]:40744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmaHF-0004St-8X for submit@debbugs.gnu.org; Mon, 27 Apr 2015 00:04:13 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:6752) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmaHC-0004Sa-RC; Mon, 27 Apr 2015 00:04:11 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFAGvvdVRMCqjW/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDSSIE6IRjGQJAQIBAoM+A4NwBKNjhFg X-IPAS-Result: AgUFAGvvdVRMCqjW/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDSSIE6IRjGQJAQIBAoM+A4NwBKNjhFg X-IronPort-AV: E=Sophos;i="5.11,557,1422939600"; d="scan'208";a="117502178" Received: from 76-10-168-214.dsl.teksavvy.com (HELO ceviche.home) ([76.10.168.214]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Apr 2015 00:04:06 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 333BB6610A; Mon, 27 Apr 2015 00:04:05 -0400 (EDT) From: Stefan Monnier To: Rafael D Sorkin Subject: Re: bug#20427: bug in optimizing compiler? Message-ID: References: Date: Mon, 27 Apr 2015 00:04:05 -0400 In-Reply-To: (Rafael D. Sorkin's message of "Sun, 26 Apr 2015 00:15:51 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: control Cc: 20427-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) tags 20427 notabug thanks > When I byte-compile a file containing the following code, with > optimization safety=0, the compiler deletes the assertion test. That's expected. Just like C's `assert', CL's `assert' can be compiled out depending on compilation options (in this case, depending on the `safety' setting). Stefan From unknown Sat Aug 16 16:00:06 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Rafael D Sorkin Subject: bug#20427: closed (Re: bug#20427: bug in optimizing compiler?) Message-ID: References: X-Gnu-PR-Message: they-closed 20427 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: notabug Reply-To: 20427@debbugs.gnu.org Date: Mon, 27 Apr 2015 04:05:05 +0000 Content-Type: multipart/mixed; boundary="----------=_1430107505-17248-1" This is a multi-part message in MIME format... ------------=_1430107505-17248-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #20427: bug in optimizing compiler? which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 20427@debbugs.gnu.org. --=20 20427: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D20427 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1430107505-17248-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 20427-done) by debbugs.gnu.org; 27 Apr 2015 04:04:13 +0000 Received: from localhost ([127.0.0.1]:40742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmaHE-0004Sr-Qu for submit@debbugs.gnu.org; Mon, 27 Apr 2015 00:04:13 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181]:6752) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmaHC-0004Sa-RC; Mon, 27 Apr 2015 00:04:11 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFAGvvdVRMCqjW/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDSSIE6IRjGQJAQIBAoM+A4NwBKNjhFg X-IPAS-Result: AgUFAGvvdVRMCqjW/2dsb2JhbAA3gVOhb4EIgXUBAQQBViMFCws0EhQYDSSIE6IRjGQJAQIBAoM+A4NwBKNjhFg X-IronPort-AV: E=Sophos;i="5.11,557,1422939600"; d="scan'208";a="117502178" Received: from 76-10-168-214.dsl.teksavvy.com (HELO ceviche.home) ([76.10.168.214]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Apr 2015 00:04:06 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 333BB6610A; Mon, 27 Apr 2015 00:04:05 -0400 (EDT) From: Stefan Monnier To: Rafael D Sorkin Subject: Re: bug#20427: bug in optimizing compiler? Message-ID: References: Date: Mon, 27 Apr 2015 00:04:05 -0400 In-Reply-To: (Rafael D. Sorkin's message of "Sun, 26 Apr 2015 00:15:51 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 20427-done Cc: 20427-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) tags 20427 notabug thanks > When I byte-compile a file containing the following code, with > optimization safety=0, the compiler deletes the assertion test. That's expected. Just like C's `assert', CL's `assert' can be compiled out depending on compilation options (in this case, depending on the `safety' setting). Stefan ------------=_1430107505-17248-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Apr 2015 04:16:06 +0000 Received: from localhost ([127.0.0.1]:40090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmDzB-0006dg-Q4 for submit@debbugs.gnu.org; Sun, 26 Apr 2015 00:16:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59974) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YmDzA-0006WL-Fo for submit@debbugs.gnu.org; Sun, 26 Apr 2015 00:16:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmDz4-00019l-61 for submit@debbugs.gnu.org; Sun, 26 Apr 2015 00:15:59 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50275) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmDz4-00019U-1n for submit@debbugs.gnu.org; Sun, 26 Apr 2015 00:15:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmDz2-0001Li-Tw for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 00:15:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YmDyz-000178-OS for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 00:15:56 -0400 Received: from mail-qg0-f100.google.com ([209.85.192.100]:36673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmDyz-000171-Kz for bug-gnu-emacs@gnu.org; Sun, 26 Apr 2015 00:15:53 -0400 Received: by qgdz60 with SMTP id z60so2892098qgd.3 for ; Sat, 25 Apr 2015 21:15:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:reply-to:from:to:subject:message-id:date; bh=MWH7gdUT6atWdoTvVvr5VistfPRAXI8UCUzfbu5ZVsY=; b=PDkrwaTXjPaMiqkjk5mOoAhe2F16pZd3ZIR1AYN/Oketw96F5jMRVrm9g3IKAN38c/ MMNSrQfUMx0BjrQ7cQ3jF5DpicNu5Tb7+gdn7GgTf+KZ1f58OEbPO/atCtCh2sLOY4BI J/9uw2sJ1J7invZ5/i7aOxI872TteumJN0UDOScp6+hDuWOf+ogTks3tRRnqPfhDLNxQ 4N5IGxfSOQf4uN+QZNoNJBGcf7bWxTZml6txiGgOCEzXL5A3Vyfu6AoRqrA/qiPrXtkq 8gP8pxufO8LBiLcA5F3OW/i/wAnbGelb1fdy/iCoLIaeclhf0xVbpz95F/58SmEPhCmo hPTw== X-Gm-Message-State: ALoCoQlMzBx9IcgKjuA5M2TGcoiD/+/U68Z1vfGHugWHwCMpmQ/UGxYSg235j/JWjCYB6PibwmGkSFd89Q5K3t+OSssxjChtkw== X-Received: by 10.50.119.101 with SMTP id kt5mr2793979igb.49.1430021752204; Sat, 25 Apr 2015 21:15:52 -0700 (PDT) Received: from mail2.pi.local (nat.perimeterinstitute.ca. [107.6.61.163]) by mx.google.com with ESMTP id ee9sm361618igb.4.2015.04.25.21.15.51; Sat, 25 Apr 2015 21:15:52 -0700 (PDT) X-Relaying-Domain: perimeterinstitute.ca Received: from mars.pi.local (mars.pi.local [10.10.7.6]) by mail2.pi.local (Postfix) with ESMTPS id 93890C0964; Sat, 25 Apr 2015 22:06:37 -0500 (CDT) Received: from rsorkin by mars.pi.local with local (Exim 4.69) (envelope-from ) id 1YmDyx-0003q2-LQ; Sun, 26 Apr 2015 00:15:51 -0400 From: Rafael D Sorkin To: bug-gnu-emacs@gnu.org Subject: bug in optimizing compiler? Message-Id: Date: Sun, 26 Apr 2015 00:15:51 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Rafael D Sorkin List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) The following report refers to this version of emacs: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian Hello, When I byte-compile a file containing the following code, with optimization safety=0, the compiler deletes the assertion test. (defmacro buggy () (assert nil nil "assertion failed -- it always should fail") "This should never show up!") This only seems to happen when i compile a file containing the macro, not when i compile the macro individually. Here is a full example (the defmacro of `buggy' is in the file "bug.test.el") (declaim (optimize (safety 3))) (byte-compile-file "bug.test.el" 'load) ; t (buggy) ; error: "assertion failed -- it always should fail" (declaim (optimize (safety 0))) (byte-compile-file "bug.test.el" 'load) ; t (buggy) ; This should never show up! I'm not sure whether this officially qualifies as a bug, but it's certainly not the behavior I was expecting. (It also doesn't seem to be present in Emacs 23.1.1) Thanks, Rafael ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- Rafael Sorkin Perimeter Institute for Theoretical Physics 31 Caroline Street North Waterloo, ON N2L 2Y5 Canada ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- ------------=_1430107505-17248-1--