re PR debug/66691 (ICE on valid code at -O3 with -g enabled in simplify_subreg, at...
[gcc.git] / gcc / reload.c
index a3edb15d4be3c7596979a10e8466a6e0b2ff2878..1dc04bf0eb96df901aad7d043f58f4d6066c4cbe 100644 (file)
@@ -96,22 +96,11 @@ a register with any other reload.  */
 #include "tm_p.h"
 #include "insn-config.h"
 #include "symtab.h"
-#include "hashtab.h"
-#include "hash-set.h"
-#include "vec.h"
-#include "machmode.h"
 #include "hard-reg-set.h"
-#include "input.h"
 #include "function.h"
 #include "rtl.h"
 #include "flags.h"
-#include "statistics.h"
-#include "double-int.h"
-#include "real.h"
-#include "fixed-value.h"
 #include "alias.h"
-#include "wide-int.h"
-#include "inchash.h"
 #include "tree.h"
 #include "expmed.h"
 #include "dojump.h"
@@ -3883,6 +3872,12 @@ find_reloads (rtx_insn *insn, int replace, int ind_levels, int live_known,
       std::swap (*recog_data.operand_loc[commutative],
                 *recog_data.operand_loc[commutative + 1]);
 
+      for (i = 0; i < recog_data.n_dups; i++)
+       if (recog_data.dup_num[i] == commutative
+           || recog_data.dup_num[i] == commutative + 1)
+         *recog_data.dup_loc[i]
+           = recog_data.operand[(int) recog_data.dup_num[i]];
+
       for (i = 0; i < n_reloads; i++)
        {
          if (rld[i].opnum == commutative)
@@ -5184,9 +5179,8 @@ find_reloads_address (machine_mode mode, rtx *memrefloc, rtx ad,
 #if !HARD_FRAME_POINTER_IS_FRAME_POINTER
           || operand == hard_frame_pointer_rtx
 #endif
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
-          || operand == arg_pointer_rtx
-#endif
+          || (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+              && operand == arg_pointer_rtx)
           || operand == stack_pointer_rtx)
          && ! maybe_memory_address_addr_space_p
                (mode, ad, as, &XEXP (XEXP (ad, 0), 1 - op_index)))
@@ -6590,7 +6584,7 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
          return 0;
        }
 
-      endregno = END_HARD_REGNO (x);
+      endregno = END_REGNO (x);
 
       return refers_to_regno_for_reload_p (regno, endregno, in, (rtx*) 0);
     }