summaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-20 02:13:39 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-20 02:13:39 +0000
commit1c6bdf07f721820a0a4d0b59f8fefa037785ed66 (patch)
treeb494bd2379913f69721d6206bfacbe19e6522eb1 /gcc/flow.c
parent23e7e0fe201743b634dd0998f1fad2ce8d51c2b1 (diff)
downloadgcc-1c6bdf07f721820a0a4d0b59f8fefa037785ed66.tar.gz
* flow.c (EH_USES): Provide default.
(calculate_global_regs_live): Use it for EH edges and noreturn calls. * doc/tm.texi (EH_USES): New. * config/ia64/ia64.c (ia64_eh_uses): New. * config/ia64/ia64-protos.h: Update. * config/ia64/ia64.h (EH_USES): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51060 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c50
1 files changed, 36 insertions, 14 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 04a3dc6b4a5..659815c5043 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -167,6 +167,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef EPILOGUE_USES
#define EPILOGUE_USES(REGNO) 0
#endif
+#ifndef EH_USES
+#define EH_USES(REGNO) 0
+#endif
#ifdef HAVE_conditional_execution
#ifndef REVERSE_CONDEXEC_PREDICATES_P
@@ -1144,21 +1147,40 @@ calculate_global_regs_live (blocks_in, blocks_out, flags)
/* Begin by propagating live_at_start from the successor blocks. */
CLEAR_REG_SET (new_live_at_end);
- for (e = bb->succ; e; e = e->succ_next)
- {
- basic_block sb = e->dest;
- /* Call-clobbered registers die across exception and call edges. */
- /* ??? Abnormal call edges ignored for the moment, as this gets
- confused by sibling call edges, which crashes reg-stack. */
- if (e->flags & EDGE_EH)
- {
- bitmap_operation (tmp, sb->global_live_at_start,
- call_used, BITMAP_AND_COMPL);
- IOR_REG_SET (new_live_at_end, tmp);
- }
- else
- IOR_REG_SET (new_live_at_end, sb->global_live_at_start);
+ if (bb->succ)
+ for (e = bb->succ; e; e = e->succ_next)
+ {
+ basic_block sb = e->dest;
+
+ /* Call-clobbered registers die across exception and
+ call edges. */
+ /* ??? Abnormal call edges ignored for the moment, as this gets
+ confused by sibling call edges, which crashes reg-stack. */
+ if (e->flags & EDGE_EH)
+ {
+ bitmap_operation (tmp, sb->global_live_at_start,
+ call_used, BITMAP_AND_COMPL);
+ IOR_REG_SET (new_live_at_end, tmp);
+ }
+ else
+ IOR_REG_SET (new_live_at_end, sb->global_live_at_start);
+
+ /* If a target saves one register in another (instead of on
+ the stack) the save register will need to be live for EH. */
+ if (e->flags & EDGE_EH)
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (EH_USES (i))
+ SET_REGNO_REG_SET (new_live_at_end, i);
+ }
+ else
+ {
+ /* This might be a noreturn function that throws. And
+ even if it isn't, getting the unwind info right helps
+ debugging. */
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (EH_USES (i))
+ SET_REGNO_REG_SET (new_live_at_end, i);
}
/* The all-important stack pointer must always be live. */