return false;
}
+/* Check if REG_INC argument in *data overlaps a stored REG. */
+
+static void
+check_invalid_inc_dec (rtx reg, const_rtx, void *data)
+{
+ rtx *pinc = (rtx *) data;
+ if (*pinc == NULL_RTX || MEM_P (reg))
+ return;
+ if (reg_overlap_mentioned_p (reg, *pinc))
+ *pinc = NULL_RTX;
+}
/* This subroutine of apply_change_group verifies whether the changes to INSN
were valid; i.e. whether INSN can still be recognized.
return 1;
}
+ /* Punt if REG_INC argument overlaps some stored REG. */
+ for (rtx link = FIND_REG_INC_NOTE (insn, NULL_RTX);
+ link; link = XEXP (link, 1))
+ if (REG_NOTE_KIND (link) == REG_INC)
+ {
+ rtx reg = XEXP (link, 0);
+ note_stores (insn, check_invalid_inc_dec, ®);
+ if (reg == NULL_RTX)
+ return 1;
+ }
+
INSN_CODE (insn) = icode;
return 0;
}
--- /dev/null
+/* PR rtl-optimization/103775 */
+/* { dg-do assemble { target int128 } } */
+/* { dg-options "-Og -fno-forward-propagate -free -g" } */
+
+int
+foo (char a, short b, int c, __int128 d, char e, short f, int g, __int128 h)
+{
+ long i = __builtin_clrsbll ((char) h);
+ __builtin_memset ((char *) &h + 4, d, 3);
+ c &= (char) h;
+ return c + i;
+}