This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12082] New: Inappropriate unreachable code warnings
- From: "augart at us dot ibm dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Aug 2003 20:39:42 -0000
- Subject: [Bug optimization/12082] New: Inappropriate unreachable code warnings
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12082
Summary: Inappropriate unreachable code warnings
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: augart at us dot ibm dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
Options given when GCC was configured/built:
I configured gcc 3.3.1 with no options; just invoked it as ./configure.
Command line that triggers the bug:
g++ -v --save-temps -Wunreachable-code -O3 preprocessModifiedFiles.C -o
preprocessModifiedFiles
Compiler output:
g++ -v --save-temps -Wunreachable-code -O3 preprocessModifiedFiles.C -o
preprocessModifiedFiles
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
Configured with: ./configure --cache-file=config.cache
Thread model: posix
gcc version 3.3.1
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/cc1plus -E -D__GNUG__=3 -quiet
-v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 -D_GNU_SOURCE
preprocessModifiedFiles.C -Wunreachable-code -O3 preprocessModifiedFiles.ii
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include/c++/3.3.1
/usr/local/include/c++/3.3.1/i686-pc-linux-gnu
/usr/local/include/c++/3.3.1/backward
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/cc1plus -fpreprocessed
preprocessModifiedFiles.ii -quiet -dumpbase preprocessModifiedFiles.C -auxbase
preprocessModifiedFiles -O3 -Wunreachable-code -version -o preprocessModifiedFiles.s
GNU C++ version 3.3.1 (i686-pc-linux-gnu)
compiled by GNU C version 3.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
preprocessModifiedFiles.C: In function `int main(int, char**)':
preprocessModifiedFiles.C:1147: warning: will never be executed
preprocessModifiedFiles.C:1147: warning: will never be executed
preprocessModifiedFiles.C:1147: warning: will never be executed
preprocessModifiedFiles.C: In function `int preprocess(const char*, const
char*)':
preprocessModifiedFiles.C:773: warning: will never be executed
preprocessModifiedFiles.C:753: warning: will never be executed
preprocessModifiedFiles.C:732: warning: will never be executed
preprocessModifiedFiles.C:747: warning: will never be executed
preprocessModifiedFiles.C:631: warning: will never be executed
preprocessModifiedFiles.C:631: warning: will never be executed
preprocessModifiedFiles.C:629: warning: will never be executed
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o preprocessModifiedFiles.o preprocessModifiedFiles.s
GNU assembler version 2.14 (i686-pc-linux-gnu) using BFD version 2.14 20030612
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/collect2 --eh-frame-hdr -m
elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o preprocessModifiedFiles
/usr/lib/crt1.o /usr/lib/crti.o
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/crtbegin.o
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../../i686-pc-linux-gnu/lib
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../..
preprocessModifiedFiles.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/crtend.o /usr/lib/crtn.o
I will attach the compressed preprocessed file preprocessModifiedFiles.ii after
I've submitted this report to Bugzilla; don't see how to do so upon bug creation.
Why I think this is a bug:
I believe the "will never be executed" warnings are incorrect.
Additional details:
I am running on an IBM Netvista type 6792-MHU computer, under a Red
Hat 7.3 GNU/Linux distribution. Linux kernel 2.40.20, 1536MB of RAM,
1GB of swap space. Pentium 4 (1.80 GHz processor). Please let me
know if I can provide you with additional information.
I compiled GCC myself from the 3.3.1 tarball, using gcc 2.96. The
build and install completed normally. Before I compiled gcc, I
compiled and installed binutils 2.14:
Bash$ gcc --version
gcc (GCC) 3.3.1
[...]
Bash$ as --version
GNU assembler 2.14 20030612
[...]
I have tried to trim down the program text I'm appending, but the
really short versions don't show the warning.
Sincerely Yours,
--Steven Augart
Jikes RVM Open Source Java Compiler Project
http://www.ibm.com/developerworks/oss/jikesrvm/