diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-01 05:50:51 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-07-01 05:50:51 +0000 |
commit | e49e8bd540832217538f9720f502da8c20f1f9b0 (patch) | |
tree | 8f6bc6f898cfafd809ea3bf6f2a7660a896f9a40 /gcc/global.c | |
parent | b528597c9f3f2e3a64a664c7be6c82a7c2688287 (diff) | |
download | gcc-e49e8bd540832217538f9720f502da8c20f1f9b0.tar.gz |
2008-07-01 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r137307
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@137309 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/global.c')
-rw-r--r-- | gcc/global.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/global.c b/gcc/global.c index cddcac3d0ac..9c22e91f857 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, @@ -216,17 +218,25 @@ compute_regsets (HARD_REG_SET *elim_set, /* Like regs_ever_live, but 1 if a reg is set or clobbered from an asm. Unlike regs_ever_live, elements of this array corresponding to eliminable regs like the frame pointer are set if an asm sets them. */ - char *regs_asm_clobbered = alloca (FIRST_PSEUDO_REGISTER * sizeof (char)); + char *regs_asm_clobbered = XALLOCAVEC (char, FIRST_PSEUDO_REGISTER); #ifdef ELIMINABLE_REGS 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 (); |