+2020-04-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/94291
+ PR rtl-optimization/84169
+ * combine.c (try_combine): For split_i2i3, don't assume SET_DEST
+ must be a REG or SUBREG of REG; if it is not one of these, don't
+ update LOG_LINKs.
+
2020-04-07 Richard Biener <rguenther@suse.de>
PR middle-end/94479
if (GET_CODE (x) == PARALLEL)
x = XVECEXP (newi2pat, 0, 0);
- /* It can only be a SET of a REG or of a SUBREG of a REG. */
- unsigned int regno = reg_or_subregno (SET_DEST (x));
-
- bool done = false;
- for (rtx_insn *insn = NEXT_INSN (i3);
- !done
- && insn
- && NONDEBUG_INSN_P (insn)
- && BLOCK_FOR_INSN (insn) == this_basic_block;
- insn = NEXT_INSN (insn))
- {
- struct insn_link *link;
- FOR_EACH_LOG_LINK (link, insn)
- if (link->insn == i3 && link->regno == regno)
- {
- link->insn = i2;
- done = true;
- break;
- }
+ if (REG_P (SET_DEST (x))
+ || (GET_CODE (SET_DEST (x)) == SUBREG
+ && REG_P (SUBREG_REG (SET_DEST (x)))))
+ {
+ unsigned int regno = reg_or_subregno (SET_DEST (x));
+
+ bool done = false;
+ for (rtx_insn *insn = NEXT_INSN (i3);
+ !done
+ && insn
+ && NONDEBUG_INSN_P (insn)
+ && BLOCK_FOR_INSN (insn) == this_basic_block;
+ insn = NEXT_INSN (insn))
+ {
+ struct insn_link *link;
+ FOR_EACH_LOG_LINK (link, insn)
+ if (link->insn == i3 && link->regno == regno)
+ {
+ link->insn = i2;
+ done = true;
+ break;
+ }
+ }
}
}
+2020-04-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/94291
+ PR rtl-optimization/84169
+ * gcc.dg/pr94291.c: New test.
+
2020-04-07 Richard Biener <rguenther@suse.de>
PR middle-end/94479
--- /dev/null
+/* PR rtl-optimization/94291 */
+/* { dg-do compile } */
+/* { dg-options "-Og" } */
+
+unsigned a;
+
+unsigned
+foo (void)
+{
+ unsigned x
+ = (__builtin_sub_overflow ((long long) a, 0, &x)
+ ? 1 : (__INTPTR_TYPE__) __builtin_memmove (&x, foo, 1));
+ return a;
+}