diff options
Diffstat (limited to 'gcc/config/sparc/sparc.c')
-rw-r--r-- | gcc/config/sparc/sparc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index f1969fe53d5..19ee7773648 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -11971,8 +11971,9 @@ sparc_frame_pointer_required (void) if (TARGET_FLAT) return false; - /* Otherwise, the frame pointer is required if the function isn't leaf. */ - return !(crtl->is_leaf && only_leaf_regs_used ()); + /* Otherwise, the frame pointer is required if the function isn't leaf, but + we cannot use sparc_leaf_function_p since it hasn't been computed yet. */ + return !(optimize > 0 && crtl->is_leaf && only_leaf_regs_used ()); } /* The way this is structured, we can't eliminate SFP in favor of SP |