The following valid code snippet triggers an ICE on mainline and 4.3 branch when compiled with "-ftrapv -O3": ================================ void foo(int x[]) { int i, j; for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) { x[i] = x[i*j]; x[i] = x[i*j]; } } ================================ bug.c: In function 'foo': bug.c:2: internal compiler error: tree check: expected integer_cst, have polynomial_chrec in int_cst_value, at tree.c:7968 Please submit a full bug report, [etc.]
Subject: Re: New: [4.3/4.4 regression] ICE with "-ftrapv" This is caused by the vectorizer. Sent from my iPhone On Mar 3, 2008, at 11:50, "reichelt at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org > wrote: > The following valid code snippet triggers an ICE on mainline and 4.3 > branch > when compiled with "-ftrapv -O3" -- Pinski
> This is caused by the vectorizer. Indeed. The ICE appears also with "-ftrapv -O -ftree-vectorize". (This still compiles fine on the 4.2 branch.)
It fails in initialize_matrix_A() when called with chrec {0, +, {0, +, 4}_1}_2: int_cst_value (CHREC_RIGHT (chrec)) ICEs, since CHREC_RIGHT (chrec) here is {0, +, 4}_1. Ira
Isn't the same problem as in pr34635? Ira
As I can no longer reproduce this I assume so. *** This bug has been marked as a duplicate of 34635 ***
No, it's not a duplicate. The bug is still present on mainline and 4.3 branch from 2008-03-12 (at least on i686-pc-linux-gnu).
The bug disappeared on mainline between 2008-04-25 and 2008-05-03.
4.3.1 is being released, adjusting target milestone.
I can no longer reproduce this on either the 4.3 branch or mainline. Volker, can you check on your end? If there is no update, I will close at the end of the week.
The bug is still present on the 4.3 branch as of 2008-08-11 (with both the C and C++ frontend).
Still can't reproduce. What target are you compiling for? Verify my steps below, and see if there's any discrepancy in what you are doing. anquetil:/build/43/gcc$ ./cc1 --version GNU C (GCC) version 4.3.2 20080812 (prerelease) [gcc-4_3-branch revision 139018] (x86_64-unknown-linux-gnu) compiled by GNU C version 4.1.2 20070925 (Red Hat 4.1.2-33), GMP version 4.2.2, MPFR version 2.3.0-p2. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 anquetil:/build/43/gcc$ ./cc1 a.c -O3 -ftrapv -quiet anquetil:/build/43/gcc$ ./cc1plus a.c -O3 -ftrapv -quiet anquetil:/build/43/gcc$ ./cc1 a.c -ftrapv -O -ftree-vectorize -quiet anquetil:/build/43/gcc$ ./cc1plus a.c -ftrapv -O -ftree-vectorize -quiet anquetil:/build/43/gcc$ uname -a Linux anquetil.quesejoda.com 2.6.24.7-92.fc8 #1 SMP Wed May 7 16:26:02 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux anquetil:/build/43/gcc$ cat a.c void foo(int x[]) { int i, j; for (i = 0; i < 2; i++) for (j = 0; j < 2; j++) { x[i] = x[i*j]; x[i] = x[i*j]; } }
I'm using i686-pc-linux-gnu. On x86_64-unknown-linux-gnu you probably need to add "-m32" to the flags.
Nope, still can't reproduce with i686-pc-linux-gnu, or with x86-64-linux using -m32. FWIW, Jakub can't reproduce it either. Can anyone beside Volker reproduce this? If nobody else can't, I'm inclined to say it's a problem on Volker's setup, and close the PR.
Fails for me on a x86_64 -> i586-linux cross ./cc1 -quiet -O3 -ftrapv /tmp/t.c /tmp/t.c: In function 'foo': /tmp/t.c:2: internal compiler error: tree check: expected integer_cst, have polynomial_chrec in int_cst_value, at tree.c:8078 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. you probably need to configure with --enable-checking.
As I alredy guessed in comment #12, the testcase really fails on native x86_64-unknown-linux-gnu with "-m32 -O3 -ftrapv". As this is a "tree check" ICE you really need to configure the compiler with --enable-checking to see it.
4.3.2 is released, changing milestones to 4.3.3.
GCC 4.3.3 is being released, adjusting target milestone.
GCC 4.3.4 is being released, adjusting target milestone.
WONTFIX on the 4.3 branch.