This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] EH_USES df fix (PR target/37378, take 2)
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Kenneth Zadeck <zadeck at naturalbridge dot com>, Ian Lance Taylor <iant at google dot com>
- Date: Mon, 24 Nov 2008 09:41:17 +0100
- Subject: Re: [PATCH] EH_USES df fix (PR target/37378, take 2)
- References: <20081027134736.GT14706@tyan-ft48-01.lab.bos.redhat.com> <200810280820.40216.ebotcazou@adacore.com> <20081028073607.GX14706@tyan-ft48-01.lab.bos.redhat.com>
> Yes, the only real difference should be bb chains ending with
> a infinite cycle though.
OK, I've installed the first version (the one strictly equivalent to flow.c)
on the 4.3 branch since the problem is responsible for the couple of ACATS
regressions on the IA-64 there:
http://gcc.gnu.org/ml/gcc-testresults/2008-11/msg02040.html
http://gcc.gnu.org/ml/gcc-testresults/2008-11/msg02041.html
Tested on ia64-suse-linux.
2008-11-24 Jakub Jelinek <jakub@redhat.com>
Eric Botcazou <ebotcazou@adacore.com>
* df-scan.c (df_get_call_refs): For unconditional noreturn calls
add EH_USES regs as artificial uses.
(df_get_entry_block_def_set): Don't handle EH_USES here.
--
Eric Botcazou
Index: df-scan.c
===================================================================
--- df-scan.c (revision 142121)
+++ df-scan.c (working copy)
@@ -3171,7 +3171,22 @@ df_get_call_refs (struct df_collection_r
}
BITMAP_FREE (defs_generated);
- return;
+
+#ifdef EH_USES
+ if ((flags & DF_REF_CONDITIONAL) == 0
+ && find_reg_note (insn, REG_NORETURN, 0))
+ {
+ unsigned int i;
+ /* This code is putting in an artificial ref for the use at the
+ BOTTOM of the block with noreturn call, as EH_USES registers need
+ to be live until epilogue or noreturn call, for debugging purposes
+ as well as any insns that might throw. */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (EH_USES (i))
+ df_ref_record (collection_rec, regno_reg_rtx[i],
+ NULL, bb, NULL, DF_REF_REG_USE, 0);
+ }
+#endif
}
/* Collect all refs in the INSN. This function is free of any
@@ -3592,16 +3607,6 @@ df_get_entry_block_def_set (bitmap entry
/* These registers are live everywhere. */
if (!reload_completed)
{
-#ifdef EH_USES
- /* The ia-64, the only machine that uses this, does not define these
- until after reload. */
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (EH_USES (i))
- {
- bitmap_set_bit (entry_block_defs, i);
- }
-#endif
-
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
/* Pseudos with argument area equivalences may require
reloading via the argument pointer. */