/* LIBCALL_SP is a zero-terminated array of insns at the end of a libcall;
their REG_EQUAL notes need updating. */
+
static bool
do_local_cprop (x, insn, alter_jumps, libcall_sp)
rtx x;
{
rtx newreg = NULL, newcnst = NULL;
- /* Rule out USE instructions and ASM statements as we don't want to change the hard registers mentioned. */
+ /* Rule out USE instructions and ASM statements as we don't want to
+ change the hard registers mentioned. */
if (GET_CODE (x) == REG
&& (REGNO (x) >= FIRST_PSEUDO_REGISTER
- || (GET_CODE (PATTERN (insn)) != USE && asm_noperands (PATTERN (insn)) < 0)))
+ || (GET_CODE (PATTERN (insn)) != USE
+ && asm_noperands (PATTERN (insn)) < 0)))
{
cselib_val *val = cselib_lookup (x, GET_MODE (x), 0);
struct elt_loc_list *l;
/* LIBCALL_SP is a zero-terminated array of insns at the end of a libcall;
their REG_EQUAL notes need updating to reflect that OLDREG has been
- replaced with NEWVAL in INSN. Return true if all substitutions could
- be made. */
+ replaced with NEWVAL in INSN. Also update the REG_EQUAL notes in INSN.
+
+ Return true if all substitutions could be made. */
+
static bool
adjust_libcall_notes (oldreg, newval, insn, libcall_sp)
rtx oldreg, newval, insn, *libcall_sp;
{
- rtx end;
+ rtx end, note;
+
+ note = find_reg_equal_equiv_note (insn);
+ if (note)
+ XEXP (note, 0) = replace_rtx (XEXP (note, 0), oldreg, newval);
while ((end = *libcall_sp++))
{
- rtx note = find_reg_equal_equiv_note (end);
+ note = find_reg_equal_equiv_note (end);
if (! note)
continue;
--- /dev/null
+/* PR opt/8165. */
+
+extern void abort (void);
+
+char buf[64];
+
+int
+main (void)
+{
+ int i;
+
+ __builtin_strcpy (buf, "mystring");
+ if (__builtin_strcmp (buf, "mystring") != 0)
+ abort ();
+
+ for (i = 0; i < 16; ++i)
+ {
+ __builtin_strcpy (buf + i, "mystring");
+ if (__builtin_strcmp (buf + i, "mystring") != 0)
+ abort ();
+ }
+
+ return 0;
+}