From 257828fcd13a73c87ca112be2b18a4838cbaa76b Mon Sep 17 00:00:00 2001 From: Andy Fiddaman Date: Wed, 26 Oct 2022 12:53:51 +0000 Subject: [PATCH] Add -fforce-omit-frame-pointer (#50) --- gcc/common.opt | 4 ++++ gcc/config/i386/i386-options.cc | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/common.opt b/gcc/common.opt index d5460f4727c27..e02f3bef41fa4 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -2230,6 +2230,10 @@ fomit-frame-pointer Common Var(flag_omit_frame_pointer) Optimization When possible do not generate stack frames. +fforce-omit-frame-pointer +Common Var(flag_force_omit_frame_pointer) Optimization +When possible, do not generate stack frames. Hinders debugging with mdb and dtrace. + fopenmp-target-simd-clone Common Alias(fopenmp-target-simd-clone=,any,none) diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc index 28bc50b7d3206..17bc9553be83c 100644 --- a/gcc/config/i386/i386-options.cc +++ b/gcc/config/i386/i386-options.cc @@ -2973,8 +2973,11 @@ ix86_option_override_internal (bool main_args_p, * questionable benefit anyway, even on i386. */ - flag_omit_frame_pointer = 0; - opts->x_flag_omit_frame_pointer = 0; + if (flag_force_omit_frame_pointer == 0) + { + flag_omit_frame_pointer = 0; + opts->x_flag_omit_frame_pointer = 0; + } /* Save the initial options in case the user does function specific options. */