The compilation is aborded after compiling the main file join as attached document. the command line is the following one. cc -O -v -save-temps -I../../src -Izlib -DUSE_LIBZ -c -o main.o main.c and the output Reading specs from /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/specs Configured with: ../gcc-3.4.0/configure --prefix=/usr --disable-debug --enable-shared Thread model: posix gcc version 3.4.0 /usr/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1 -E -quiet -v -I../../src -Izlib -DUSE_LIBZ main.c -mtune=pentiumpro -O -o main.i ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/3.4.0/../../../../i686-pc-linux-gnu/include" ignoring nonexistent directory "../../src" ignoring nonexistent directory "zlib" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc/i686-pc-linux-gnu/3.4.0/include /usr/include End of search list. /usr/libexec/gcc/i686-pc-linux-gnu/3.4.0/cc1 -fpreprocessed main.i -quiet -dumpbase main.c -mtune=pentiumpro -auxbase-strip main.o -O -version -o main.s GNU C version 3.4.0 (i686-pc-linux-gnu) compiled by GNU C version 3.4.0. GGC heuristics: --param ggc-min-expand=64 --param ggc-min-heapsize=64571 main.c: In function `mainTotalTaskEntryInitialisations': main.c:2237: internal compiler error: output_operand: invalid expression as operand Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. Some precision about my computer. This is a laptop with pentium4 processor and linux kernel 2.6.5 and glibc 2.3.2.
Created attachment 6665 [details] All files needed to crash gcc The file contains all headers files and source file in c, needed to crash gcc during compilation. I also add the *.i and *.s file.
Confirmed. Working on a small testcase. W.
This is a 3.4/3.5 regression: ------------------------ extern char ca[4000000]; extern int i; void foo() { i = 0; i = (int)(ca+ (3 - ((int)(ca+i-1) & 3))); } ------------------------- g/x> /home/bangerth/bin/gcc-3.3.4-pre/bin/gcc -c x.c -O g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c x.c -O x.c: In function `foo': x.c:7: internal compiler error: output_operand: invalid expression as operand Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. g/x> /home/bangerth/bin/gcc-3.5-pre/bin/gcc -c x.c -O x.c: In function `foo': x.c:7: internal compiler error: output_operand: invalid expression as operand Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. W.
Even more compact testcase: ======================================== char c; int foo() { return 1 - (1 & (int)(&c-1)); } ========================================
The problem is that the back-end does not reject (const:SI (neg:SI (symbol_ref:SI ("c") <var_decl 0x401004fc c>))) as a constant, I think this is just like the case where 1-c was not rejected also.
Richard, this looks like it might have an easy fix. Care to take a whack?
Testing patch.
Subject: Bug 16298 CVSROOT: /cvs/gcc Module name: gcc Changes by: rth@gcc.gnu.org 2004-08-24 21:46:00 Modified files: gcc : ChangeLog gcc/config/i386: i386.c Log message: PR target/16298 * config/i386/i386.c (legitimate_constant_p): Rework to not accept random codes within CONST. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5074&r2=2.5075 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&r1=1.715&r2=1.716
Subject: Bug 16298 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: rth@gcc.gnu.org 2004-08-25 05:19:09 Modified files: gcc : ChangeLog gcc/config/i386: i386.c Log message: PR target/16298 * config/i386/i386.c (legitimate_constant_p): Rework to not accept random codes within CONST. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.593&r2=2.2326.2.594 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.635.2.14&r2=1.635.2.15
Fixed.
Richard, is there a reason why the testcase wasn't added to the testsuite?
Um, no, I guess not.