From 38aa4d08b72826276844708d538e5e610d65f0b2 Mon Sep 17 00:00:00 2001 From: Joey Ye Date: Mon, 30 Jun 2008 17:51:49 +0000 Subject: global.c (compute_regsets): Set frame_pointer_needed here. 2008-06-30 Joey Ye H.J. Lu * global.c (compute_regsets): Set frame_pointer_needed here. * reload1.c (init_elim_table): Don't set frame_pointer_needed here. Co-Authored-By: H.J. Lu From-SVN: r137275 --- gcc/global.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'gcc/global.c') diff --git a/gcc/global.c b/gcc/global.c index 8ccad6b..9c22e91 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -206,7 +206,9 @@ static void build_insn_chain (void); This will normally be called with ELIM_SET as the file static variable eliminable_regset, and NO_GLOBAL_SET as the file static - variable NO_GLOBAL_ALLOC_REGS. */ + variable NO_GLOBAL_ALLOC_REGS. + + It also initializes global flag frame_pointer_needed. */ static void compute_regsets (HARD_REG_SET *elim_set, @@ -222,11 +224,19 @@ compute_regsets (HARD_REG_SET *elim_set, static const struct {const int from, to; } eliminables[] = ELIMINABLE_REGS; size_t i; #endif + + /* FIXME: If EXIT_IGNORE_STACK is set, we will not save and restore + sp for alloca. So we can't eliminate the frame pointer in that + case. At some point, we should improve this by emitting the + sp-adjusting insns for this case. */ int need_fp = (! flag_omit_frame_pointer || (cfun->calls_alloca && EXIT_IGNORE_STACK) + || crtl->accesses_prior_frames || FRAME_POINTER_REQUIRED); + frame_pointer_needed = need_fp; + max_regno = max_reg_num (); compact_blocks (); -- cgit v1.1