diff options
Diffstat (limited to 'gcc/config/i386/i386.c')
-rw-r--r-- | gcc/config/i386/i386.c | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7145e9299f2..b4d2087bcd7 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1000,6 +1000,27 @@ override_options () 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_asynchronous_unwind_tables = 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_asynchronous_unwind_tables = 0; + if (flag_pcc_struct_return == 2) + flag_pcc_struct_return = 1; + } + #ifdef SUBTARGET_OVERRIDE_OPTIONS SUBTARGET_OVERRIDE_OPTIONS; #endif @@ -1212,9 +1233,6 @@ override_options () ix86_tls_dialect_string); } - if (profile_flag) - target_flags &= ~MASK_OMIT_LEAF_FRAME_POINTER; - /* Keep nonleaf frame pointers. */ if (TARGET_OMIT_LEAF_FRAME_POINTER) flag_omit_frame_pointer = 1; @@ -1319,15 +1337,15 @@ optimization_options (level, size) 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; + + /* The default values of these switches depend on the TARGET_64BIT + 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; } /* Table of valid machine attributes. */ @@ -4045,7 +4063,10 @@ ix86_frame_pointer_required () the frame pointer by default. Turn it back on now if we've not got a leaf function. */ if (TARGET_OMIT_LEAF_FRAME_POINTER - && (!current_function_is_leaf || current_function_profile)) + && (!current_function_is_leaf)) + return 1; + + if (current_function_profile) return 1; return 0; |