This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix combine EH related failure
On Wed, Feb 18, 2004 at 10:13:58AM +1030, Alan Modra wrote:
> I also noticed some other places in combine.c that were checking for
> REG_UNUSED notes without looking for REG_EH_REGION. A followup patch
> will address them..
Just one place matters.
* combine.c (can_combine_p): Don't ignore SETs marked with
REG_EH_REGION notes.
OK mainline, assuming bootstrap and no new regressions? Should this go
on the 3.4 branch too?
Index: gcc/combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.410
diff -u -p -r1.410 combine.c
--- gcc/combine.c 17 Feb 2004 22:21:00 -0000 1.410
+++ gcc/combine.c 17 Feb 2004 23:58:15 -0000
@@ -963,6 +963,7 @@ can_combine_p (rtx insn, rtx i3, rtx pre
for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
{
rtx elt = XVECEXP (PATTERN (insn), 0, i);
+ rtx note;
switch (GET_CODE (elt))
{
@@ -1013,6 +1014,8 @@ can_combine_p (rtx insn, rtx i3, rtx pre
/* Ignore SETs whose result isn't used but not those that
have side-effects. */
if (find_reg_note (insn, REG_UNUSED, SET_DEST (elt))
+ && (!(note = find_reg_note (insn, REG_EH_REGION, NULL_RTX))
+ || INTVAL (XEXP (note, 0)) <= 0)
&& ! side_effects_p (elt))
break;
--
Alan Modra
IBM OzLabs - Linux Technology Centre