public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13472] New: optimizer generates code to store data in const int, resulting in a segfault
@ 2003-12-23  3:23 p dot van-hoof at qub dot ac dot uk
  2003-12-23  3:45 ` [Bug c/13472] " p dot van-hoof at qub dot ac dot uk
                   ` (21 more replies)
  0 siblings, 22 replies; 23+ messages in thread
From: p dot van-hoof at qub dot ac dot uk @ 2003-12-23  3:23 UTC (permalink / raw)
  To: gcc-bugs

When the attached program is compiled with the following options:

dogbert> gcc -v -pedantic -march=i686 -O2 r.c
Reading specs from /usr/local/gcc333/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/specs
Configured with: ../gcc/configure --prefix=/usr/local/gcc333
--enable-languages=c,c++,f77
Thread model: posix
gcc version 3.3.3 20031223 (prerelease)
 /usr/local/gcc333/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/cc1 -quiet -v
-D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=3 r.c -quiet -dumpbase r.c
-march=i686 -auxbase r -O2 -pedantic -version -o /tmp/cccX38fK.s
GNU C version 3.3.3 20031223 (prerelease) (i686-pc-linux-gnu)
        compiled by GNU C version 3.3.3 20031223 (prerelease).
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128958
ignoring nonexistent directory "/usr/local/gcc333/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/gcc333/include
 /usr/local/gcc333/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/include
 /usr/include
End of search list.
 as -V -Qy -o /tmp/ccgjNrLm.o /tmp/cccX38fK.s
GNU assembler version 2.14.90.0.5 (i586-suse-linux) using BFD version
2.14.90.0.5 20030722 (SuSE Linux)
 /usr/local/gcc333/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/collect2 --eh-frame-hdr
-m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o
/usr/local/gcc333/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/crtbegin.o
-L/usr/local/gcc333/lib/gcc-lib/i686-pc-linux-gnu/3.3.3
-L/usr/local/gcc333/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../.. /tmp/ccgjNrLm.o
-lgcc -lgcc_eh -lc -lgcc -lgcc_eh
/usr/local/gcc333/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/crtend.o /usr/lib/crtn.o
dogbert> a.out
Segmentation fault

All command line parameters are essential to produce the bug (including
-pedantic; I wasn't aware that this switch affected code generation...).

The bug is triggered for all of the following platforms: i686, pentium2, athlon,
athlon-tbird.

The bug occurs with gcc 3.3.3, 3.3.2 and 3.3.1, but not with gcc 3.2.3.

Upon inspecting the assembler output it appears that the optimizer generates
code that tries to overwrite the const int q.

-- 
           Summary: optimizer generates code to store data in const int,
                    resulting in a segfault
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: p dot van-hoof at qub dot ac dot uk
                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


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


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

end of thread, other threads:[~2004-04-18 21:50 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-23  3:23 [Bug c/13472] New: optimizer generates code to store data in const int, resulting in a segfault p dot van-hoof at qub dot ac dot uk
2003-12-23  3:45 ` [Bug c/13472] " p dot van-hoof at qub dot ac dot uk
2003-12-23  6:23 ` [Bug optimization/13472] [3.3 Regression] " pinskia at gcc dot gnu dot org
2003-12-23 14:50 ` ebotcazou at gcc dot gnu dot org
2003-12-23 14:53 ` ebotcazou at gcc dot gnu dot org
2003-12-26 14:10 ` pinskia at gcc dot gnu dot org
2004-01-07  8:41 ` ebotcazou at gcc dot gnu dot org
2004-01-11 21:27 ` pinskia at gcc dot gnu dot org
2004-01-21  3:29 ` dhazeghi at yahoo dot com
2004-01-21  3:35 ` gdr at integrable-solutions dot net
2004-01-21  7:23 ` ebotcazou at gcc dot gnu dot org
2004-01-21  7:36 ` ebotcazou at gcc dot gnu dot org
2004-01-21  7:37 ` ebotcazou at gcc dot gnu dot org
2004-01-21  7:38 ` gdr at integrable-solutions dot net
2004-01-21  8:36 ` ebotcazou at gcc dot gnu dot org
2004-01-21 14:06 ` gdr at integrable-solutions dot net
2004-01-21 14:33 ` ebotcazou at gcc dot gnu dot org
2004-01-29  5:04 ` gdr at gcc dot gnu dot org
2004-01-29  5:12 ` pinskia at gcc dot gnu dot org
2004-03-08  7:13 ` ebotcazou at gcc dot gnu dot org
2004-03-13  0:31 ` cvs-commit at gcc dot gnu dot org
2004-03-13  0:35 ` gdr at gcc dot gnu dot org
2004-04-18 22:43 ` pinskia 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).