all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#20427: bug in optimizing compiler?
@ 2015-04-26  4:15 Rafael D Sorkin
  2015-04-27  4:04 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael D Sorkin @ 2015-04-26  4:15 UTC (permalink / raw)
  To: 20427

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
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#20427: bug in optimizing compiler?
  2015-04-26  4:15 bug#20427: bug in optimizing compiler? Rafael D Sorkin
@ 2015-04-27  4:04 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2015-04-27  4:04 UTC (permalink / raw)
  To: Rafael D Sorkin; +Cc: 20427-done

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-27  4:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-26  4:15 bug#20427: bug in optimizing compiler? Rafael D Sorkin
2015-04-27  4:04 ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.