[Bug middle-end/28411] gfortran: Internal error: Illegal instruction
--- Comment #4 from uros at kss-loka dot si 2006-07-18 07:29 --- This is the backtrace for the testcase in comment #3: #1 0x0827ae67 in fold_binary_to_constant (code=TRUNC_MOD_EXPR, type=0x402473f4, op0=0x402d9438, op1=0x0) at ../../gcc-svn/trunk/gcc/fold-const.c:12314 #2 0x08174b25 in constant_multiple_of (type=0x402473f4, top=0x402d9438, bot=0x0) at ../../gcc-svn/trunk/gcc/tree-ssa-loop-ivopts.c:2623 #3 0x081799d1 in get_computation_cost (data=0xb704, use=0x8706e70, cand=0x8707358, address_p=0 '\0', depends_on=0xb5f4) at ../../gcc-svn/trunk/gcc/tree-ssa-loop-ivopts.c:3758 #4 0x0817a364 in determine_use_iv_cost (data=0xb704, use=0x8706e70, cand=0x8707358) at ../../gcc-svn/trunk/gcc/tree-ssa-loop-ivopts.c:3901 #5 0x0817d41e in determine_use_iv_costs (data=0xb704) at ../../gcc-svn/trunk/gcc/tree-ssa-loop-ivopts.c:4128 #6 0x0817f3ac in tree_ssa_iv_optimize_loop (data=0xb704, loop=Variable loop is not available. constant_multiple_of() is calling fold_binary_to_constant() here: if (!zero_p (fold_binary_to_constant (TRUNC_MOD_EXPR, type, top, bot))) return NULL_TREE; As can be seen from backtrace above, bot operand is NULL, and this triggers assert in fold_binary(). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28411
[Bug middle-end/28411] gfortran: Internal error: Illegal instruction
--- Comment #3 from langton at gcc dot gnu dot org 2006-07-17 22:26 --- This doesn't appear to be a gfortran bug. On both i686-darwin and i686-pc-linux, a comparable C program crashes in the same way: york.llnl.gov(831)% cat foo.c void test_check_sums() { const int SIZE = 10; int array_i4[SIZE]; long long array_i8[SIZE]; double array_r8[SIZE]; float array_r4[SIZE]; int n; for (n = 0; n SIZE; n++) { array_i4[n] = (int) -3*n; array_i8[n] = (long long) -3*n; array_r4[n] = (float) -3*n; array_r8[n] = (double) -3*n; } } york.llnl.gov(832)% gcc -ftrapv -c -O2 foo.c foo.c: In function 'test_check_sums': foo.c:2: internal compiler error: in fold_binary, at fold-const.c:8239 Please submit a full bug report, with preprocessed source if appropriate. See URL:http://gcc.gnu.org/bugs.html for instructions. york.llnl.gov(833)% gcc -v Using built-in specs. Target: i386-apple-darwin8.7.1 Configured with: ../../source/mainline_source/configure --prefix=/home/langton2/opt_mactel/ --with-gmp=/home/langton2/opt_mactel/ --with-mpfr=/home/langton2/opt_mactel/ --enable-languages=c,fortran Thread model: posix gcc version 4.2.0 20060703 (experimental) -- langton at gcc dot gnu dot org changed: What|Removed |Added Component|fortran |middle-end http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28411