]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/19683 (MIPS wrong-code for 64-bit multiply.)
authorRichard Sandiford <rsandifo@redhat.com>
Thu, 17 Mar 2005 21:11:49 +0000 (21:11 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Thu, 17 Mar 2005 21:11:49 +0000 (21:11 +0000)
PR rtl-optimization/19683
* reload1.c (choose_reload_regs): Pass the number of bits, not the
number of bytes, to smallest_int_for_mode.  Fix arguments to
REG_CANNOT_CHANGE_MODE_P.

From-SVN: r96634

gcc/ChangeLog
gcc/reload1.c
gcc/testsuite/ChangeLog

index f79ba564729b02de4c04669412c2b4c158abf3f6..95c3050a3b3f36907a96c22f3ae6f4ab75d83e8c 100644 (file)
@@ -1,3 +1,10 @@
+2005-03-17  Richard Sandiford  <rsandifo@redhat.com>
+
+       PR rtl-optimization/19683
+       * reload1.c (choose_reload_regs): Pass the number of bits, not the
+       number of bytes, to smallest_int_for_mode.  Fix arguments to
+       REG_CANNOT_CHANGE_MODE_P.
+
 2005-03-17  Alan Modra  <amodra@bigpond.net.au>
 
        * config/rs6000/linux-unwind.h: New file backported from gcc-4.0.
index bd2bb706a1f8c759f35714cb20d7465e50f941b5..26f62aa2ee5c245f80fb251c123a75f8e808983a 100644 (file)
@@ -5412,19 +5412,18 @@ choose_reload_regs (struct insn_chain *chain)
                    need_mode = mode;
                  else
                    need_mode
-                     = smallest_mode_for_size (GET_MODE_SIZE (mode) + byte,
+                     = smallest_mode_for_size (GET_MODE_BITSIZE (mode)
+                                               + byte * BITS_PER_UNIT,
                                                GET_MODE_CLASS (mode));
 
-                 if (
-#ifdef CANNOT_CHANGE_MODE_CLASS
-                     (!REG_CANNOT_CHANGE_MODE_P (i, GET_MODE (last_reg),
-                                                 need_mode)
-                      &&
-#endif
-                     (GET_MODE_SIZE (GET_MODE (last_reg))
+                 if ((GET_MODE_SIZE (GET_MODE (last_reg))
                       >= GET_MODE_SIZE (need_mode))
 #ifdef CANNOT_CHANGE_MODE_CLASS
-                     )
+                     /* Verify that the register in "i" can be obtained
+                        from LAST_REG.  */
+                     && !REG_CANNOT_CHANGE_MODE_P (REGNO (last_reg),
+                                                   GET_MODE (last_reg),
+                                                   mode)
 #endif
                      && reg_reloaded_contents[i] == regno
                      && TEST_HARD_REG_BIT (reg_reloaded_valid, i)
index 4c207599e3802858f971271ba02f09cae475318a..e6c3650bcaaf03d265df400a058f4cf1692943f6 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-17  Richard Sandiford  <rsandifo@redhat.com>
+
+       * gcc.dg/torture/pr19683-1.c: New test.
+
 2005-03-16  Roger Sayle  <roger@eyesopen.com>
 
        PR rtl-optimization/17825