Compilation *crashes* when -O argument is greater than 0 (i.e. -O1, -O2, or -O3). If -O0 is used (or -O is omitted) compilation *passes*.
Note that "a" below needs to be external to the function. If the line "char* a;" is placed inside the test() function, compilation *passes*. REDUCED TEST CASE: File "test.c": char* a; void test() { a = "0"; a = a + 1; return; } /* test() */ OUTPUT: mcore-elf-gcc -c -O2 test.c test.c: In function 'test': test.c:9: error: unrecognizable insn: (insn 12 11 13 1 (set (reg:SI 26) (const:SI (plus:SI (symbol_ref/f:SI ("*.LC0") [flags 0x2] <string_cst 0xb72f54a0>) (const_int 1 [0x1])))) -1 (nil) (nil)) test.c:9: internal compiler error: in extract_insn, at recog.c:2084 GCC CONFIGURATION: % mcore-elf-gcc -v Using built-in specs. Target: mcore-elf Configured with: /tmp/bld/gcc/gcc-4.1.2/configure --target=mcore-elf --enable-languages=c,c++ --enable-multilib --with-gnu-as --with-gnu-ld --with-newlib --prefix=/_TOOLS_/dist/gnu-gcc-4.1.2-binutils-2.17-mcore-elf/i686-pc-linux2.4 Thread model: single gcc version 4.1.2 OTHER RELEASES: Test case fails in 4.1.1 Test case passes in 4.0.4 POSSIBLE DUPLICATES: 25690 -- Symptom is different (bug involves structure deference) but cause might be the same (points to the same line of code in the compiler source) -- Summary: Pointer Arithmetic Crash When Optimizing Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: major Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: r dot slater at freescale dot com GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: mcore-elf http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31702