re PR target/21501 (ICE in extract_insn, at recog.c:2082)
authorRichard Earnshaw <rearnsha@arm.com>
Thu, 12 May 2005 10:36:03 +0000 (10:36 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Thu, 12 May 2005 10:36:03 +0000 (10:36 +0000)
PR target/21501
* arm.c (arm_gen_constant): Sign-extend intermediate values when
synthesizing a constant of the difference of two immediates.

From-SVN: r99608

gcc/ChangeLog
gcc/config/arm/arm.c

index fd59b358caf4283761d89b73ba55f94a7c40b2b2..50a41d1f69aadd81d5f081c9c4fa06995df599c0 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-12  Richard Earnshaw  <richard.earnshaw@arm.com>
+
+       PR target/21501
+       * arm.c (arm_gen_constant): Sign-extend intermediate values when
+       synthesizing a constant of the difference of two immediates.
+
 2005-05-12  Richard Earnshaw  <richard.earnshaw@arm.com>
 
        * arm/vfp.md (negsf2_vfp): Add alternative using integer registers.
index 905187ad2f97df35014e732798fb7ef33281c7f3..c1d1fa8e8973e9a52c7765e8b0e23e6be5275313 100644 (file)
@@ -1920,8 +1920,8 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
        {
          int topshift = clear_sign_bit_copies & ~1;
 
-         temp1 = ((remainder + (0x00800000 >> topshift))
-                  & (0xff000000 >> topshift));
+         temp1 = ARM_SIGN_EXTEND ((remainder + (0x00800000 >> topshift))
+                                  & (0xff000000 >> topshift));
 
          /* If temp1 is zero, then that means the 9 most significant
             bits of remainder were 1 and we've caused it to overflow.
@@ -1930,7 +1930,7 @@ arm_gen_constant (enum rtx_code code, enum machine_mode mode, rtx cond,
          if (temp1 == 0 && topshift != 0)
            temp1 = 0x80000000 >> (topshift - 1);
 
-         temp2 = temp1 - remainder;
+         temp2 = ARM_SIGN_EXTEND (temp1 - remainder);
          
          if (const_ok_for_arm (temp2))
            {