public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/54561] New: incorrect setjmp -Wclobber diagnostics
@ 2012-09-12 20:53 eggert at gnu dot org
  2012-09-12 21:02 ` [Bug middle-end/54561] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: eggert at gnu dot org @ 2012-09-12 20:53 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54561
           Summary: incorrect setjmp -Wclobber diagnostics
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: eggert@gnu.org


Created attachment 28180
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28180
generates incorrect diagnostics with gcc -O2 -Wclobbered

If I compile the attached program via the command "gcc -S -Wclobbered
-O2 w.i" (GCC 4.7.1, x86-64, Fedora 17), the output is:

w.i: In function 'png_load_body':
w.i:37:13: warning: variable 'info_ptr' might be clobbered by 'longjmp' or
'vfork' [-Wclobbered]
w.i:38:9: warning: variable 'fp' might be clobbered by 'longjmp' or 'vfork'
[-Wclobbered]

Both warnings are incorrect, because info_ptr and fp are not live
across any possible longjmp.  If longjmp munges these variables,
setjmp must return a nonzero value, and no uses of these variables are
reachable in that case.

Like Bug#48968, I ran into this problem when building Emacs.  This test
case is much shorter, though (I whittled it down), so it should be
easier to debug.


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

end of thread, other threads:[~2014-03-19  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-12 20:53 [Bug c/54561] New: incorrect setjmp -Wclobber diagnostics eggert at gnu dot org
2012-09-12 21:02 ` [Bug middle-end/54561] " pinskia at gcc dot gnu.org
2012-09-12 23:39 ` eggert at gnu dot org
2014-03-19  4:57 ` mat at matws dot net
2014-03-19  8:47 ` mikpelinux at gmail dot com

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).