This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
i386 patch to add SUBTARGET_OPTIMIZATION_OPTIONS
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 18 Nov 2004 17:23:24 +0000 (UTC)
- Subject: i386 patch to add SUBTARGET_OPTIMIZATION_OPTIONS
This patch adds SUBTARGET_OPTIMIZATION_OPTIONS to the i386 port so
that there can be a subtarget-specific default of
-momit-leaf-frame-pointer depending on the -O level but overridden if
the user passes -momit-leaf-frame-pointer or
-mno-omit-leaf-frame-pointer explicitly, and makes Solaris 10 use this
feature so that -momit-leaf-frame-pointer is only the default at -O1
and above. This yields better debuggability of unoptimised binaries
and better GDB testsuite results.
Bootstrapped with no regressions on i386-pc-solaris2.10. OK to
commit?
2004-11-18 Joseph Myers <joseph@codesourcery.com>
* config/i386/i386.c (optimization_options): Use
SUBTARGET_OPTIMIZATION_OPTIONS.
* config/i386/sol2-10.h (SUBTARGET_OPTIMIZATION_OPTIONS): Define.
(TARGET_SUBTARGET_DEFAULT): Don't include
MASK_OMIT_LEAF_FRAME_POINTER.
Index: gcc/config/i386/i386.c
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.635.2.15.2.1
diff -u -r1.635.2.15.2.1 i386.c
--- gcc/config/i386/i386.c 23 Sep 2004 07:27:09 -0000 1.635.2.15.2.1
+++ gcc/config/i386/i386.c 17 Nov 2004 13:09:03 -0000
@@ -1533,6 +1533,9 @@
flag_omit_frame_pointer = 2;
flag_pcc_struct_return = 2;
flag_asynchronous_unwind_tables = 2;
+#ifdef SUBTARGET_OPTIMIZATION_OPTIONS
+ SUBTARGET_OPTIMIZATION_OPTIONS;
+#endif
}
/* Table of valid machine attributes. */
Index: gcc/config/i386/sol2-10.h
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config/i386/Attic/sol2-10.h,v
retrieving revision 1.1.4.4
diff -u -r1.1.4.4 sol2-10.h
--- gcc/config/i386/sol2-10.h 13 Oct 2004 06:19:02 -0000 1.1.4.4
+++ gcc/config/i386/sol2-10.h 17 Nov 2004 13:12:02 -0000
@@ -51,8 +51,15 @@
#undef TARGET_SUBTARGET_DEFAULT
#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP \
- | MASK_FLOAT_RETURNS \
- | MASK_OMIT_LEAF_FRAME_POINTER)
+ | MASK_FLOAT_RETURNS)
+
+#define SUBTARGET_OPTIMIZATION_OPTIONS \
+ do \
+ { \
+ if (optimize >= 1) \
+ target_flags |= MASK_OMIT_LEAF_FRAME_POINTER; \
+ } \
+ while (0)
#define MULTILIB_DEFAULTS { "m32" }
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)