c/5471: gcc crashes when compiling test.c with -O3 but works fine with -O2
lahorani@yahoo.com
lahorani@yahoo.com
Wed Jan 23 15:56:00 GMT 2002
>Number: 5471
>Category: c
>Synopsis: gcc crashes when compiling test.c with -O3 but works fine with -O2
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jan 23 15:56:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Sumeet
>Release: gcc version 2.95.3 20010315 (SuSE)
>Organization:
>Environment:
Output from gcc -v -save-temps
Reading specs from /usr/lib/gcc-lib/i486-suse-linux/2.95.3/specs
gcc version 2.95.3 20010315 (SuSE)
/usr/lib/gcc-lib/i486-suse-linux/2.95.3/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__OPTIMIZE__ -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di486 -D__i486 -D__i486__ foo.c foo.i
GNU CPP version 2.95.3 20010315 (SuSE) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i486-suse-linux/2.95.3/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/usr/include/g++
/usr/lib/gcc-lib/i486-suse-linux/2.95.3/../../../../i486-suse-linux/include
End of omitted list.
/usr/lib/gcc-lib/i486-suse-linux/2.95.3/cc1 foo.i -quiet -dumpbase foo.c -O3 -version -o foo.s
GNU C version 2.95.3 20010315 (SuSE) (i486-suse-linux) compiled by GNU C version 2.95.3 20010315 (SuSE).
>Description:
gcc crashes when compiling the attached test.c with -O3. The
compilation goes through fine with -O2.
I've just reduced this testcase to use int * everywhere but
in reality I have structures and func1() is a function which
has side-effects and modifies the the contents of Iterator.
>How-To-Repeat:
gcc -O3 test.c
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-unknown-content-type-cfile; name="test.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.c"
dm9pZCAqZnVuYzEoaW50ICphKTsKaW50IGZ1bmMyKGludCAqYSk7Cgp2b2lkIGZ1bmMzKCkKewog
IGludCAqSXRlcmF0b3I7CgogIEl0ZXJhdG9yID0gKGludCAqKTA7IAoKICB3aGlsZSAoMSkgewog
ICAgaW50ICBQb3NpdGlvbiAgICAgICA9IDA7CiAgICBpbnQgIGk7CiAgICBpbnQgKiBPcGVyYW5k
ICA9IGZ1bmMxKEl0ZXJhdG9yKTsKCiAgICBpZiAoT3BlcmFuZCA9PSAoaW50ICopMCkgYnJlYWs7
IAoKICAgIGlmIChmdW5jMihPcGVyYW5kKSkKICAgICAgUG9zaXRpb24gPSAxOwoKICAgIGZvciAo
aSA9IFBvc2l0aW9uOyBpID49IDA7IGktLSkKICAgIHsKICAgIH0gIAogIH0KCiAgcmV0dXJuOwp9
Cg==
More information about the Gcc-prs
mailing list