public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27795]  New: optimizer produces faulty code
@ 2006-05-29 16:52 S dot Diederich at gmx dot de
  2006-05-29 16:53 ` [Bug c++/27795] " S dot Diederich at gmx dot de
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: S dot Diederich at gmx dot de @ 2006-05-29 16:52 UTC (permalink / raw)
  To: gcc-bugs

The attached (simple) piece of code segfaults if compiled with (>=)-O2.
There are several possibilities to trigger the error.
1. Using the attached cpp, compile with -O2 ends in segfault when running the
app (-O{0,1} is fine)
2. If the cout in the last line is removed, everything seems to be fine
3. If line 16 is exchanged with line 15, everything is fine, too.
(tested on gentoo and SuSE)

Output of "g++ -v -save-temps -O2 compilerbugCPP.cpp -o compilerbug":
Using built-in specs.
Target: i586-suse-linux
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info
--mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib
--enable-languages=c,c++,objc,fortran,java,ada --enable-checking=release
--with-gxx-include-dir=/usr/include/c++/4.1.0 --enable-ssp --disable-libssp
--enable-java-awt=gtk --enable-gtk-cairo --disable-libjava-multilib
--with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit
--enable-libstdcxx-allocator=new --without-system-libunwind --with-cpu=generic
--host=i586-suse-linux
Thread model: posix
gcc version 4.1.0 (SUSE Linux)
 /usr/lib/gcc/i586-suse-linux/4.1.0/cc1plus -E -quiet -v -D_GNU_SOURCE
compilerbugCPP.cpp -mtune=generic -O2 -fpch-preprocess -o compilerbugCPP.ii
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.1.0
 /usr/include/c++/4.1.0/i586-suse-linux
 /usr/include/c++/4.1.0/backward
 /usr/local/include
 /usr/lib/gcc/i586-suse-linux/4.1.0/include
 /usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/include
 /usr/include
End of search list.
 /usr/lib/gcc/i586-suse-linux/4.1.0/cc1plus -fpreprocessed compilerbugCPP.ii
-quiet -dumpbase compilerbugCPP.cpp -mtune=generic -auxbase compilerbugCPP -O2
-version -o compilerbugCPP.s
GNU C++ version 4.1.0 (SUSE Linux) (i586-suse-linux)
        compiled by GNU C version 4.1.0 (SUSE Linux).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129317
Compiler executable checksum: c877835e2478fb620b785c23d7318e1f
 /usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/bin/as -V -Qy
-o compilerbugCPP.o compilerbugCPP.s
GNU assembler version 2.16.91.0.5 (i586-suse-linux) using BFD version
2.16.91.0.5 20051219 (SUSE Linux)
 /usr/lib/gcc/i586-suse-linux/4.1.0/collect2 --eh-frame-hdr -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 -o compilerbug
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../crt1.o
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../crti.o
/usr/lib/gcc/i586-suse-linux/4.1.0/crtbegin.o
-L/usr/lib/gcc/i586-suse-linux/4.1.0 -L/usr/lib/gcc/i586-suse-linux/4.1.0
-L/usr/lib/gcc/i586-suse-linux/4.1.0/../../../../i586-suse-linux/lib
-L/usr/lib/gcc/i586-suse-linux/4.1.0/../../.. compilerbugCPP.o -lstdc++ -lm
-lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/i586-suse-linux/4.1.0/crtend.o
/usr/lib/gcc/i586-suse-linux/4.1.0/../../../crtn.o


-- 
           Summary: optimizer produces faulty code
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: S dot Diederich at gmx dot de


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


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

end of thread, other threads:[~2006-07-24  8:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-29 16:52 [Bug c++/27795] New: optimizer produces faulty code S dot Diederich at gmx dot de
2006-05-29 16:53 ` [Bug c++/27795] " S dot Diederich at gmx dot de
2006-05-29 16:54 ` S dot Diederich at gmx dot de
2006-05-29 16:58 ` [Bug tree-optimization/27795] [4.1/4.2 Regression] optimizer produces faulty code [tree-vrp] pinskia at gcc dot gnu dot org
2006-05-29 17:05 ` [Bug tree-optimization/27795] [4.1 " pinskia at gcc dot gnu dot org
2006-05-29 18:03 ` pinskia at gcc dot gnu dot org
2006-05-30 13:46 ` rguenth at gcc dot gnu dot org
2006-07-21 12:27 ` rguenth at gcc dot gnu dot org
2006-07-24  8:26 ` rguenth at gcc dot gnu dot org
2006-07-24  8:29 ` rguenth at gcc dot gnu dot 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).