public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/56982] New: Bad optimization with setjmp()
@ 2013-04-16 14:31 jdemeyer at cage dot ugent.be
  2013-04-16 14:31 ` [Bug tree-optimization/56982] " jdemeyer at cage dot ugent.be
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: jdemeyer at cage dot ugent.be @ 2013-04-16 14:31 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56982

             Bug #: 56982
           Summary: Bad optimization with setjmp()
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jdemeyer@cage.ugent.be
            Target: x86_64-pc-linux-gnu


Created attachment 29883
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29883
Bug program

Compile the example program with gcc -Og jmp.c -o jmp

Run the program ./jmp and the output is

Returning 1
x = 0, n = 1
Returning 0
x = 42, n = 1
Aborted

The function g() is returning 0 the second time (after longjmp()) but the
return value, assigned to n, equals 1. With other optimization levels or with
earlier versions of gcc or with -Og -fno-tree-dominator-opts, the output is
what I expect:

Returning 1
x = 0, n = 1
Returning 0
x = 42, n = 0

This is with gcc version 4.8.0, GNU libc version 2.15.


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

end of thread, other threads:[~2014-12-10 12:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-16 14:31 [Bug tree-optimization/56982] New: Bad optimization with setjmp() jdemeyer at cage dot ugent.be
2013-04-16 14:31 ` [Bug tree-optimization/56982] " jdemeyer at cage dot ugent.be
2013-04-16 16:04 ` [Bug tree-optimization/56982] [4.8/4.9 Regression] " jakub at gcc dot gnu.org
2013-04-17  8:26 ` rguenth at gcc dot gnu.org
2013-04-17  8:56 ` jakub at gcc dot gnu.org
2013-04-17  9:07 ` rguenther at suse dot de
2013-04-17  9:58 ` rguenth at gcc dot gnu.org
2013-04-18  1:17 ` bugfeed at online dot de
2013-04-19 13:40 ` [Bug tree-optimization/56982] [4.8 " rguenth at gcc dot gnu.org
2013-05-22 11:28 ` rguenth at gcc dot gnu.org
2013-05-31 10:59 ` jakub at gcc dot gnu.org
2013-06-20 10:23 ` rguenth at gcc dot gnu.org
2013-07-02 22:26 ` bernd.edlinger at hotmail dot de
2013-07-02 23:14 ` mikpe at it dot uu.se
2013-07-03  8:05 ` bernd.edlinger at hotmail dot de
2013-10-16  9:49 ` jakub at gcc dot gnu.org
2014-05-22  9:05 ` rguenth at gcc dot gnu.org
2014-12-10 12:37 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).