public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50321] New: Erroneous unreachable code warning.
@ 2011-09-07 14:26 till at pps dot jussieu.fr
  2011-09-07 15:10 ` [Bug c/50321] " rguenth at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: till at pps dot jussieu.fr @ 2011-09-07 14:26 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50321
           Summary: Erroneous unreachable code warning.
    Classification: Unclassified
           Product: gcc
           Version: 4.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: till@pps.jussieu.fr


The following code:

  extern int intf ( void );
  extern void voidf ( void );

  void f ( void ) {
    int v = (intf ())?-1:0; /* Change -1 to 1 and the bug goes away*/
    if (v) voidf ();
  }

warns about unreachable code when compiled with

  gcc -g -Werror -O1 -Wunreachable-code -c bug.c

(the -g is important)

  cc1: warnings being treated as errors
  bug.c: In function ‘f’:
  bug.c:5: error: will never be executed


The machine used to compile this is an up to date centos 6 x86_64 machine. The
full version of gcc is:

Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)


The bug didn't appear on gcc 4.6 (debian) and 4.2. I suspect that this might be
caused by a red hat patch.


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

* [Bug c/50321] Erroneous unreachable code warning.
  2011-09-07 14:26 [Bug c/50321] New: Erroneous unreachable code warning till at pps dot jussieu.fr
@ 2011-09-07 15:10 ` rguenth at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-09-07 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-09-07 15:06:56 UTC ---
-Wunreachable-code has been removed as it was completely broken.


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

end of thread, other threads:[~2011-09-07 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-07 14:26 [Bug c/50321] New: Erroneous unreachable code warning till at pps dot jussieu.fr
2011-09-07 15:10 ` [Bug c/50321] " 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).