* i386.c (override_options): Set defaults for flag_omit_frame_pointer,
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Oct 2002 17:16:52 +0000 (17:16 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 31 Oct 2002 17:16:52 +0000 (17:16 +0000)
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.
Do not clear -momit-leaf-frame-pointer when profiling.
(ix86_frame_pointer_required): Frame pointer is allways required when
profiling.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58681 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c

index e08e26b..03c3499 100644 (file)
@@ -1,3 +1,13 @@
+Thu Oct 31 18:08:00 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.
+       Do not clear -momit-leaf-frame-pointer when profiling.
+       (ix86_frame_pointer_required): Frame pointer is allways required when
+       profiling.
+
 Thu Oct 31 16:09:44 CET 2002  Jan Hubicka  <jh@suse.cz>
 
        * i386.md (negdf2_ifs_rex64): Don't allow GPR operand.
index 7145e92..b4d2087 100644 (file)
@@ -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;
 }
 \f
 /* 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;