+2015-07-23 Kugan Vivekanandarajah <kuganv@linaro.org>
+
+ * config/arm/arm.c (arm_emit_movpair): Add REG_EQUAL notes to
+ instruction.
+
2015-07-23 Kugan Vivekanandarajah <kuganv@linaro.org>
* cse.c (cse_insn): Fix missing check for STRICT_LOW_PART and minor
void
arm_emit_movpair (rtx dest, rtx src)
{
+ rtx insn;
+
/* If the src is an immediate, simplify it. */
if (CONST_INT_P (src))
{
HOST_WIDE_INT val = INTVAL (src);
emit_set_insn (dest, GEN_INT (val & 0x0000ffff));
if ((val >> 16) & 0x0000ffff)
- emit_set_insn (gen_rtx_ZERO_EXTRACT (SImode, dest, GEN_INT (16),
- GEN_INT (16)),
- GEN_INT ((val >> 16) & 0x0000ffff));
+ {
+ emit_set_insn (gen_rtx_ZERO_EXTRACT (SImode, dest, GEN_INT (16),
+ GEN_INT (16)),
+ GEN_INT ((val >> 16) & 0x0000ffff));
+ insn = get_last_insn ();
+ set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
+ }
return;
}
emit_set_insn (dest, gen_rtx_HIGH (SImode, src));
emit_set_insn (dest, gen_rtx_LO_SUM (SImode, dest, src));
+ insn = get_last_insn ();
+ set_unique_reg_note (insn, REG_EQUAL, copy_rtx (src));
}
/* Output a move between double words. It must be REG<-MEM
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-rtl-expand" } */
+
+extern void abort (void);
+unsigned int a = 1;
+
+int
+main (void)
+{
+ unsigned int b, c, d;
+
+ if (sizeof (int) != 4 || (int) 0xc7d24b5e > 0)
+ return 0;
+
+ c = 0xc7d24b5e;
+ d = a | -2;
+ b = (d == 0) ? c : (c % d);
+ if (b != c)
+ abort ();
+
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump "expr_list:REG_EQUAL \\(const_int -942519458" "expand" } } */