re PR target/53621 ([SH] Frame pointers not generated with -fno-omit-frame-pointer...
authorChristian Bruel <christian.bruel@st.com>
Thu, 14 Jun 2012 08:38:22 +0000 (10:38 +0200)
committerChristian Bruel <chrbr@gcc.gnu.org>
Thu, 14 Jun 2012 08:38:22 +0000 (10:38 +0200)
PR target/53621
* config/sh/sh.c (sh_option_override): Don't force
flag_omit_frame_pointer and maccumulate_outgoing_args.
* config/sh/sh.opt (maccumulate-outgoing-args): Init as Var.

* gcc.dg/stack-usage-1.c: Force -fomit-frame-pointer on SH.

From-SVN: r188598

gcc/ChangeLog
gcc/config/sh/sh.c
gcc/config/sh/sh.opt
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/stack-usage-1.c

index 308798367e6cfbd1f75632898467734c8dc442b3..f2e1f25b377250b30410ff3f68f0066cd4520406 100644 (file)
@@ -1,3 +1,10 @@
+2012-06-12  Christian Bruel  <christian.bruel@st.com>
+
+       PR target/53621
+       * config/sh/sh.c (sh_option_override): Don't force
+        flag_omit_frame_pointer and maccumulate_outgoing_args.
+       * config/sh/sh.opt (maccumulate-outgoing-args): Init as Var.
+
 2012-06-14  Richard Guenther  <rguenther@suse.de>
 
        * tree-vrp.c (VR_INITIALIZER): New define.
index 4c6b9cf7af7c121d6853e703ebf0241cf95f8c1b..cdfd7b6bce8915477cdaf7f1d16877c12d4e4a92 100644 (file)
@@ -751,8 +751,6 @@ sh_option_override (void)
     if (! VALID_REGISTER_P (ADDREGNAMES_REGNO (regno)))
       sh_additional_register_names[regno][0] = '\0';
 
-  flag_omit_frame_pointer = (PREFERRED_DEBUGGING_TYPE == DWARF2_DEBUG);
-
   if ((flag_pic && ! TARGET_PREFERGOT)
       || (TARGET_SHMEDIA && !TARGET_PT_FIXED))
     flag_no_function_cse = 1;
@@ -784,22 +782,17 @@ sh_option_override (void)
        flag_schedule_insns = 0;
     }
 
-    if ((target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS) == 0)
-       target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
-
-  /* Unwind info is not correct around the CFG unless either a frame 
-     pointer is present or M_A_O_A is set.  Fixing this requires rewriting 
-     unwind info generation to be aware of the CFG and propagating states 
+  /* Unwind info is not correct around the CFG unless either a frame
+     pointer is present or M_A_O_A is set.  Fixing this requires rewriting
+     unwind info generation to be aware of the CFG and propagating states
      around edges.  */
   if ((flag_unwind_tables || flag_asynchronous_unwind_tables
-       || flag_exceptions || flag_non_call_exceptions)   
-      && flag_omit_frame_pointer
-      && !(target_flags & MASK_ACCUMULATE_OUTGOING_ARGS))
-    {
-      if (target_flags_explicit & MASK_ACCUMULATE_OUTGOING_ARGS)
-       warning (0, "unwind tables currently require either a frame pointer "
-                "or -maccumulate-outgoing-args for correctness");
-      target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
+       || flag_exceptions || flag_non_call_exceptions)
+      && flag_omit_frame_pointer && !TARGET_ACCUMULATE_OUTGOING_ARGS)
+    {
+      warning (0, "unwind tables currently require either a frame pointer "
+              "or -maccumulate-outgoing-args for correctness");
+      TARGET_ACCUMULATE_OUTGOING_ARGS = 1;
     }
 
   /* Unwinding with -freorder-blocks-and-partition does not work on this
index bcbe4f73a6a3c57346950ba8673c1419e03c12af..76e66e288995f24dcbd02fabf1b4a35cc8572261 100644 (file)
@@ -202,7 +202,7 @@ Target RejectNegative Condition(SUPPORT_SH5_32MEDIA_NOFPU)
 Generate FPU-less SHcompact code
 
 maccumulate-outgoing-args
-Target Report Mask(ACCUMULATE_OUTGOING_ARGS)
+Target Report Var(TARGET_ACCUMULATE_OUTGOING_ARGS) Init(1)
 Reserve space for outgoing arguments in the function prologue
 
 madjust-unroll
index 7f203a8bbccf57f68e0ffcab8509927bf4616a06..74e831447bc3645ecd1e11c099a47bf1fb5b81c7 100644 (file)
@@ -1,3 +1,8 @@
+2012-06-13  Christian Bruel  <christian.bruel@st.com>
+
+       PR target/53621
+       * gcc.dg/stack-usage-1.c: Force -fomit-frame-pointer on SH.
+
 2012-06-14  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * gcc.target/mips/mips.exp (mips-dg-options): Handle -msynci.
index 78bb51d9bb25502963bc0c7c2d19c2c66551a80f..9142228668389912e9bc8efb3e081e25aefb15ed 100644 (file)
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-fstack-usage" } */
+/* { dg-options "-fstack-usage -fomit-frame-pointer" { target { sh-*-* } } } */
 
 /* This is aimed at testing basic support for -fstack-usage in the back-ends.
    See the SPARC back-end for example (grep flag_stack_usage_info in sparc.c).