I can reproduce it with GCC 4.7 r177601 with -marm but not with -mthumb. Here a smaller test case that seems related.
> cat tst2.c
typedef signed char int8_t ; typedef signed short int16_t; typedef signed long int32_t; typedef signed long long int64_t;
// doesn't ice if arg is unsigned // doesn't ice if return is int32_t instead of int64_t int64_t foo(int8_t * arg) { //int64_t temp_1; int64_t temp_1;
temp_1 = arg[256]; // index must be > 255 to ice! return temp_1; }
> arm-none-eabi-gcc -O1 tst2.c
tst2.c: In function 'foo': tst2.c:15:1: error: unrecognizable insn: (insn 22 21 23 2 (set (subreg:SI (reg:DI 138 [ MEM[(int8_t *)arg_1(D) + 256B] ]) 0) (sign_extend:SI (mem:QI (plus:SI (reg:SI 0 r0 [ arg ]) (const_int 256 [0x100])) [0 MEM[(int8_t *)arg_1(D) + 256B]+0 S1 A8]))) tst2.c:13 -1 (nil)) tst2.c:15:1: internal compiler error: in extract_insn, at recog.c:2115
-- Greta
I can reproduce it with GCC 4.7 r177601 with -marm but not with -mthumb.
Here a smaller test case that seems related.
> cat tst2.c
typedef signed char int8_t ;
typedef signed short int16_t;
typedef signed long int32_t;
typedef signed long long int64_t;
// doesn't ice if arg is unsigned
// doesn't ice if return is int32_t instead of int64_t
int64_t foo(int8_t * arg)
{
//int64_t temp_1;
int64_t temp_1;
temp_1 = arg[256]; // index must be > 255 to ice!
return temp_1;
}
> arm-none-eabi-gcc -O1 tst2.c
tst2.c: In function 'foo':
(sign_ extend: SI (mem:QI (plus:SI (reg:SI 0 r0 [ arg ])
( const_int 256 [0x100])) [0 MEM[(int8_t *)arg_1(D) + 256B]+0 S1 A8]))) tst2.c:13 -1
tst2.c:15:1: error: unrecognizable insn:
(insn 22 21 23 2 (set (subreg:SI (reg:DI 138 [ MEM[(int8_t *)arg_1(D) + 256B] ]) 0)
(nil))
tst2.c:15:1: internal compiler error: in extract_insn, at recog.c:2115
-- Greta