poly_int64 update_sp_offset)
{
int icode = recog_memoized (insn);
- rtx old_set = single_set (insn);
+ rtx set, old_set = single_set (insn);
bool validate_p;
int i;
rtx substed_operand[MAX_RECOG_OPERANDS];
for (i = 0; i < static_id->n_dups; i++)
*id->dup_loc[i] = substed_operand[(int) static_id->dup_num[i]];
+ /* Transform plus (plus (hard reg, const), pseudo) to plus (plus (pseudo,
+ const), hard reg) in order to keep insn containing eliminated register
+ after all reloads calculating its offset. This permits to keep register
+ pressure under control and helps to avoid LRA cycling in patalogical
+ cases. */
+ if (! replace_p && (set = single_set (insn)) != NULL
+ && GET_CODE (SET_SRC (set)) == PLUS
+ && GET_CODE (XEXP (SET_SRC (set), 0)) == PLUS)
+ {
+ rtx reg1, reg2, op1, op2;
+
+ reg1 = op1 = XEXP (XEXP (SET_SRC (set), 0), 0);
+ reg2 = op2 = XEXP (SET_SRC (set), 1);
+ if (GET_CODE (reg1) == SUBREG)
+ reg1 = SUBREG_REG (reg1);
+ if (GET_CODE (reg2) == SUBREG)
+ reg2 = SUBREG_REG (reg2);
+ if (REG_P (reg1) && REG_P (reg2)
+ && REGNO (reg1) < FIRST_PSEUDO_REGISTER
+ && REGNO (reg2) >= FIRST_PSEUDO_REGISTER)
+ {
+ XEXP (XEXP (SET_SRC (set), 0), 0) = op2;
+ XEXP (SET_SRC (set), 1) = op1;
+ }
+ }
+
/* If we had a move insn but now we don't, re-recognize it.
This will cause spurious re-recognition if the old move had a
PARALLEL since the new one still will, but we can't call
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -fno-omit-frame-pointer -mthumb -w -Os" } */
+
+typedef a[23];
+enum { b };
+typedef struct {
+ int c;
+ char *e;
+ char f
+} d;
+typedef enum { g = 1 } h;
+typedef struct {
+ h i;
+ int j
+} k;
+typedef struct {
+ a l;
+ int a;
+ int m;
+ int n;
+ int o;
+ short p;
+ int q;
+ k r;
+ char e;
+ char *s;
+ d t;
+ d *u;
+ short v;
+ int w
+} aa;
+c(char x, int y, char z, int ab) {
+ aa ac;
+ ac.r.i = 0;
+ d ad;
+ ac.t = ad;
+ ac.u = 0;
+ ae(&ac.v, 0, 0);
+ ac.w = 0;
+ af(&ac, x + y, z, z + ab);
+ if (ag(0))
+ return 0;
+ if (x)
+ ac.s = z + ab;
+ else
+ ac.s = x + y;
+ ac.o |= g;
+ if (!setjmp()) {
+ ah(ac);
+ ai(b);
+ ac.e = z + ab;
+ aj(ac);
+ }
+}