This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR 16373: -fomit-frame-pointer when optimizing on x86
- From: Roger Sayle <roger at eyesopen dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 11 Jul 2004 17:06:02 -0600 (MDT)
- Subject: [PATCH] PR 16373: -fomit-frame-pointer when optimizing on x86
I was orginally just going to ask whether there were any remaining
hold-ups to enabling -fomit-frame-pointer by default when optimizing
on IA-32. More pro-actively, I thought I'd propose the following patch
and see what people think. The x86_64 targets in i386.c already do
this by default, and with the variable tracking changes, gcc 3.5 will
already require users to use a recent gdb 6.x for debugging.
The following patch has been tested on i686-pc-linux-gnu with a full
"make bootstrap", all default languages, and regression tested with a
top-level "make -k check" with no new failures. I'll admit that I've
never run the gdb testsuite, but I'd hope that by now any regressions
there would be considered problems with gdb :)
Ok for mainline?
2004-07-11 Roger Sayle <roger@eyesopen.com>
PR middle-end/16373
* config/i386/i386.h (CAN_DEBUG_WITHOUT_FP): Define.
* config/i386/i386.c (optimization_options): Don't track
whether flag_omit_frame_pointer has been specified by user.
(override_options): Don't adjust target dependent default for
flag_omit_frame_pointer.
Index: i386.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.h,v
retrieving revision 1.388
diff -c -3 -p -r1.388 i386.h
*** i386.h 7 Jul 2004 19:24:17 -0000 1.388
--- i386.h 11 Jul 2004 19:53:17 -0000
*************** struct machine_function GTY(())
*** 3119,3124 ****
--- 3119,3127 ----
#define X86_FILE_START_VERSION_DIRECTIVE false
#define X86_FILE_START_FLTUSED false
+ /* Show we can debug even without a frame pointer. */
+ #define CAN_DEBUG_WITHOUT_FP
+
/*
Local variables:
version-control: t
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.689
diff -c -3 -p -r1.689 i386.c
*** i386.c 10 Jul 2004 19:01:40 -0000 1.689
--- i386.c 11 Jul 2004 19:53:20 -0000
*************** override_options (void)
*** 1199,1206 ****
in case they weren't overwritten by command line options. */
if (TARGET_64BIT)
{
- if (flag_omit_frame_pointer == 2)
- flag_omit_frame_pointer = 1;
if (flag_asynchronous_unwind_tables == 2)
flag_asynchronous_unwind_tables = 1;
if (flag_pcc_struct_return == 2)
--- 1199,1204 ----
*************** override_options (void)
*** 1208,1215 ****
}
else
{
- if (flag_omit_frame_pointer == 2)
- flag_omit_frame_pointer = 0;
if (flag_asynchronous_unwind_tables == 2)
flag_asynchronous_unwind_tables = 0;
if (flag_pcc_struct_return == 2)
--- 1206,1211 ----
*************** optimization_options (int level, int siz
*** 1578,1585 ****
that is not known at this moment. Mark these values with 2 and
let user the to override these. In case there is no command line option
specifying them, we will set the defaults in override_options. */
- if (optimize >= 1)
- flag_omit_frame_pointer = 2;
flag_pcc_struct_return = 2;
flag_asynchronous_unwind_tables = 2;
}
--- 1574,1579 ----
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833