This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Set proper defaults for i386 on x86-64 compiler
- From: Jan Hubicka <jh at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org, rth at cygnus dot com
- Date: Wed, 30 Oct 2002 23:11:35 +0100
- Subject: Set proper defaults for i386 on x86-64 compiler
Hi,
For x86-64 we want several switch to have different default values than i386
and still we want to let user to overwrite the default by specific
switch. Cleanest approach I was able to come with is the hack attached
in the patch.
Honza
Wed Oct 30 23:09:18 CET 2002 Jan Hubicka <jh@suse.cz>
* i386.c (override_options): Set defaults for flag_omit_frame_pointer,
flag_asynchronous_unwind_tables, flag_pcc_struct_return.
* i386.c (optimization_options): Set flag_omit_frame_pointer,
flag_asynchronous_unwind_tables, flag_pcc_struct_return to 2.
Index: i386.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.c,v
retrieving revision 1.447.2.17
diff -c -3 -p -r1.447.2.17 i386.c
*** i386.c 28 Oct 2002 19:48:28 -0000 1.447.2.17
--- i386.c 29 Oct 2002 16:22:56 -0000
*************** override_options ()
*** 1018,1023 ****
--- 1018,1046 ----
real_format_for_mode[XFmode - QFmode] = &ieee_extended_intel_96_format;
real_format_for_mode[TFmode - QFmode] = &ieee_extended_intel_128_format;
+ /* Set the default values for switches whose defualt depends on TARGET_64BIT
+ in case they wasn't overwriten 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_omit_frame_pointer = 1;
+ if (flag_pcc_struct_return == 2)
+ flag_pcc_struct_return = 0;
+ }
+ else
+ {
+ if (flag_omit_frame_pointer == 2)
+ flag_omit_frame_pointer = 0;
+ if (flag_asynchronous_unwind_tables == 2)
+ flag_omit_frame_pointer = 0;
+ if (flag_pcc_struct_return == 2)
+ flag_pcc_struct_return = 1;
+ }
+ if (profile_flag)
+ flag_omit_frame_pointer = 0;
+
#ifdef SUBTARGET_OVERRIDE_OPTIONS
SUBTARGET_OVERRIDE_OPTIONS;
#endif
*************** optimization_options (level, size)
*** 1337,1351 ****
if (level > 1)
flag_schedule_insns = 0;
#endif
! if (TARGET_64BIT && optimize >= 1)
! flag_omit_frame_pointer = 1;
! if (TARGET_64BIT)
! {
! flag_pcc_struct_return = 0;
! flag_asynchronous_unwind_tables = 1;
! }
! if (profile_flag)
! flag_omit_frame_pointer = 0;
}
/* Table of valid machine attributes. */
--- 1360,1374 ----
if (level > 1)
flag_schedule_insns = 0;
#endif
!
! /* The default values of these switches dependd on the TARGET_64BIT
! that is not known at this moment. Mark these values with 2 and
! let user 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;
}
/* Table of valid machine attributes. */