From 8ac49ecba7150b4121b219d8e141d8e90a5e2fe4 Mon Sep 17 00:00:00 2001 From: "Balaji V. Iyer" Date: Wed, 13 Mar 2013 18:23:08 +0000 Subject: Removed the frame pointer required setting from target to common files. gcc/ChangeLog.cilkplus +2013-03-13 Balaji V. Iyer + + * config/i386/i386.c (ix86_frame_pointer_required): Removed statements + that checks if cilkplus is enabled and if the function is a cilk + function. + * ira.c (ira_setup_eliminable_regset): Enforce frame pointer usage when + it cilkplus is enabled and if the function is a cilk function. + * reload1.c (update_eliminables): Likewise. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/cilkplus@196637 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog.cilkplus | 9 +++++++++ gcc/config/i386/i386.c | 4 ---- gcc/ira.c | 21 ++++++++++++--------- gcc/reload1.c | 3 ++- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog.cilkplus b/gcc/ChangeLog.cilkplus index 5d0138a585b..fe02abdb24f 100644 --- a/gcc/ChangeLog.cilkplus +++ b/gcc/ChangeLog.cilkplus @@ -1,3 +1,12 @@ +2013-03-13 Balaji V. Iyer + + * config/i386/i386.c (ix86_frame_pointer_required): Removed statements + that checks if cilkplus is enabled and if the function is a cilk + function. + * ira.c (ira_setup_eliminable_regset): Enforce frame pointer usage when + it cilkplus is enabled and if the function is a cilk function. + * reload1.c (update_eliminables): Likewise. + 2013-03-12 Balaji V. Iyer * builtins.c (expand_builtin): Added a check if cilkscreen is available diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index efbe07989ee..0e21b88e1a9 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -8532,10 +8532,6 @@ ix86_can_use_return_insn_p (void) static bool ix86_frame_pointer_required (void) { - /* For all Cilk specific functions, we frame pointer is required. */ - if (flag_enable_cilk && cfun->is_cilk_function == 1) - return true; - /* If we accessed previous frames, then the generated code expects to be able to access the saved ebp value in our frame. */ if (cfun->machine->accesses_prev_frame) diff --git a/gcc/ira.c b/gcc/ira.c index 03b336831fa..b96b96fabbf 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -1865,15 +1865,18 @@ ira_setup_eliminable_regset (bool from_ira_p) 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. */ - frame_pointer_needed - = (! flag_omit_frame_pointer - || (cfun->calls_alloca && EXIT_IGNORE_STACK) - /* We need the frame pointer to catch stack overflow exceptions - if the stack pointer is moving. */ - || (flag_stack_check && STACK_CHECK_MOVING_SP) - || crtl->accesses_prior_frames - || crtl->stack_realign_needed - || targetm.frame_pointer_required ()); + if (flag_enable_cilk && cfun && cfun->is_cilk_function == 1) + frame_pointer_needed = true; + else + frame_pointer_needed + = (! flag_omit_frame_pointer + || (cfun->calls_alloca && EXIT_IGNORE_STACK) + /* We need the frame pointer to catch stack overflow exceptions + if the stack pointer is moving. */ + || (flag_stack_check && STACK_CHECK_MOVING_SP) + || crtl->accesses_prior_frames + || crtl->stack_realign_needed + || targetm.frame_pointer_required ()); if (from_ira_p && ira_use_lra_p) /* It can change FRAME_POINTER_NEEDED. We call it only from IRA diff --git a/gcc/reload1.c b/gcc/reload1.c index cbb945d064e..e4ae1d1487f 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -3960,7 +3960,8 @@ update_eliminables (HARD_REG_SET *pset) for (ep = reg_eliminate; ep < ®_eliminate[NUM_ELIMINABLE_REGS]; ep++) if ((ep->from == HARD_FRAME_POINTER_REGNUM - && targetm.frame_pointer_required ()) + && ((flag_enable_cilk && cfun && cfun->is_cilk_function == 1) + || targetm.frame_pointer_required ())) #ifdef ELIMINABLE_REGS || ! targetm.can_eliminate (ep->from, ep->to) #endif -- cgit v1.2.3