Index: gcc/config/arm/arm.c =================================================================== --- gcc/config/arm/arm.c (revision 148169) +++ gcc/config/arm/arm.c (working copy) @@ -4266,15 +4266,17 @@ thumb2_legitimate_index_p (enum machine_ if (mode == DImode || mode == DFmode) { - HOST_WIDE_INT val = INTVAL (index); - /* ??? Can we assume ldrd for thumb2? */ - /* Thumb-2 ldrd only has reg+const addressing modes. */ - if (code != CONST_INT) + if (code == CONST_INT) + { + HOST_WIDE_INT val = INTVAL (index); + /* ??? Can we assume ldrd for thumb2? */ + /* Thumb-2 ldrd only has reg+const addressing modes. */ + /* ldrd supports offsets of +-1020. + However the ldr fallback does not. */ + return val > -256 && val < 256 && (val & 3) == 0; + } + else return 0; - - /* ldrd supports offsets of +-1020. - However the ldr fallback does not. */ - return val > -256 && val < 256 && (val & 3) == 0; } if (code == MULT)