[preliminary fix for PR49069 ICE on ARM, not yet submitted upstream ] gcc/ 2011-09-24 Mikael Pettersson PR target/49069 * config/arm/arm.md (cstoredi4): If both operands are constants, FAIL the expansion rather than throwing assertion failure. gcc/testsuite/ 2011-09-24 Mikael Pettersson PR target/49069 * gcc.dg/pr49069.c: New test. --- gcc-4.6.1/gcc/config/arm/arm.md.~1~ 2011-04-13 09:41:08.000000000 +0200 +++ gcc-4.6.1/gcc/config/arm/arm.md 2011-09-24 14:31:31.000000000 +0200 @@ -7522,8 +7522,9 @@ (define_expand "cstoredi4" enum rtx_code code = GET_CODE (operands[1]); /* We should not have two constants. */ - gcc_assert (GET_MODE (operands[2]) == DImode - || GET_MODE (operands[3]) == DImode); + if (!(GET_MODE (operands[2]) == DImode + || GET_MODE (operands[3]) == DImode)) + FAIL; /* Flip unimplemented DImode comparisons to a form that arm_gen_compare_reg can handle. */ --- gcc-4.6.1/gcc/testsuite/gcc.dg/pr49069.c.~1~ 1970-01-01 01:00:00.000000000 +0100 +++ gcc-4.6.1/gcc/testsuite/gcc.dg/pr49069.c 2011-09-24 14:31:31.000000000 +0200 @@ -0,0 +1,29 @@ +/* PR target/49069 */ +/* { dg-do compile } */ + +__extension__ typedef unsigned long long int uint64_t; + +int +func1 () +{ +} + +static int +func2 (int a, int b) +{ + return a == 0 ? a : a / b; +} + +int array1[1]; +const uint64_t array2[1] = { 1 }; + +void +foo (void) +{ + for (array1[0] = 0; array1[0] == 1; array1[0] = func1 ()) + { + } + if (bar (array2[0] == func2 (array1[0], 0)) == 0) + { + } +}