+2003-12-20 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/13031
+ * gcse.c (cprop_jump): Backport code clean-up and bug-fix
+ from mainline [2003-05-20 Sayle, Hirata and Rennecke patch].
+ (cprop_insn): Don't attemp further substitutions if the
+ current instruction has been deleted.
+ (local_cprop_pass): Likewise.
+
2003-12-19 Jakub Jelinek <jakub@redhat.com>
PR c++/13239
rtx from;
rtx src;
{
- rtx new, new_set;
+ rtx new;
rtx set = pc_set (jump);
+ rtx set_src = SET_SRC (set);
/* First substitute in the INSN condition as the SET_SRC of the JUMP,
then substitute that given values in this expanded JUMP. */
- if (setcc != NULL
+ if (setcc != NULL_RTX
&& !modified_between_p (from, setcc, jump)
&& !modified_between_p (src, setcc, jump))
{
rtx setcc_set = single_set (setcc);
- new_set = simplify_replace_rtx (SET_SRC (set),
+ set_src = simplify_replace_rtx (set_src,
SET_DEST (setcc_set),
SET_SRC (setcc_set));
}
else
- new_set = set;
+ setcc = NULL_RTX;
- new = simplify_replace_rtx (new_set, from, src);
+ new = simplify_replace_rtx (set_src, from, src);
/* If no simplification can be made, then try the next
register. */
- if (rtx_equal_p (new, new_set) || rtx_equal_p (new, SET_SRC (set)))
+ if (rtx_equal_p (new, SET_SRC (set)))
return 0;
/* If this is now a no-op delete it, otherwise this must be a valid insn. */
print_rtl (gcse_file, src);
fprintf (gcse_file, "\n");
}
+ if (INSN_DELETED_P (insn))
+ return 1;
}
}
else if (GET_CODE (src) == REG
changed = true;
break;
}
+ if (INSN_DELETED_P (insn))
+ break;
}
while (reg_use_count);
}
--- /dev/null
+/* PR optimization/13031 */
+/* The following code used to ICE on alphaev67-*-* at -O2 with an
+ unrecognizable instruction, caused by local register allocation
+ substituting a register for a constant in a conditional branch. */
+
+void emit(int, int);
+int f(void);
+static int signals[5];
+
+static inline void select(int sel, void *klass)
+{
+ emit(klass ? 0 : f(), signals[sel ? 0 : 1]);
+}
+
+void all(void *gil, void *l, void *icon)
+{
+ while (l)
+ if (icon)
+ select(0, gil);
+}
+