* config/avr/avr.c (avr_option_override): Set
authorgjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Oct 2011 17:25:48 +0000 (17:25 +0000)
committergjl <gjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Oct 2011 17:25:48 +0000 (17:25 +0000)
flag_omit_frame_pointer to 0 if frame pointer is needed for
unwinding.

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

gcc/ChangeLog
gcc/config/avr/avr.c

index fc29829..b4bf897 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-10  Georg-Johann Lay  <avr@gjlay.de>
+
+       * config/avr/avr.c (avr_option_override): Set
+       flag_omit_frame_pointer to 0 if frame pointer is needed for
+       unwinding.
+
 2011-10-10  Uros Bizjak  <ubizjak@gmail.com>
 
        PR bootstrap/50665
index c28b593..d8cc84a 100644 (file)
@@ -351,6 +351,21 @@ avr_option_override (void)
 {
   flag_delete_null_pointer_checks = 0;
 
+  /* Unwind tables currently require a frame pointer for correctness,
+     see toplev.c:process_options().  */
+
+  if ((flag_unwind_tables
+       || flag_non_call_exceptions
+       || flag_asynchronous_unwind_tables)
+      && !ACCUMULATE_OUTGOING_ARGS)
+    {
+      flag_omit_frame_pointer = 0;
+    }
+  else
+    {
+      flag_omit_frame_pointer = (optimize >= 1);
+    }
+
   avr_current_device = &avr_mcu_types[avr_mcu_index];
   avr_current_arch = &avr_arch_types[avr_current_device->arch];
   avr_extra_arch_macro = avr_current_device->macro;