diff mbox

[AVR] : Avoid unwind warning from toplev.c

Message ID 4E931BFB.2010506@gjlay.de
State New
Headers show

Commit Message

Georg-Johann Lay Oct. 10, 2011, 4:23 p.m. UTC
toplev.c complains about "unwind tables currently require a frame pointer for
correctness".

This patchlet supplies a fix to avoid build warnings/test fails in that it sets
flag_omit_frame_pointer to 0 if unwind needs FP.

toplev.c:process_options sets flag_unwind_tables depending on
flag_non_call_exceptions and flag_asynchronous_unwind_tables after calling
targetm.target_option.override() so that the test includes these flags, too.

Ok?

Johann

	* config/avr/avr.c (avr_option_override): Set
	flag_omit_frame_pointer to 0 if frame pointer is needed for
	unwinding.

Comments

Denis Chertykov Oct. 10, 2011, 5:10 p.m. UTC | #1
2011/10/10 Georg-Johann Lay <avr@gjlay.de>:
> toplev.c complains about "unwind tables currently require a frame pointer for
> correctness".
>
> This patchlet supplies a fix to avoid build warnings/test fails in that it sets
> flag_omit_frame_pointer to 0 if unwind needs FP.
>
> toplev.c:process_options sets flag_unwind_tables depending on
> flag_non_call_exceptions and flag_asynchronous_unwind_tables after calling
> targetm.target_option.override() so that the test includes these flags, too.
>
> Ok?
>
> Johann
>
>        * config/avr/avr.c (avr_option_override): Set
>        flag_omit_frame_pointer to 0 if frame pointer is needed for
>        unwinding.
>

Approved.

Denis.
diff mbox

Patch

Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c	(revision 179744)
+++ config/avr/avr.c	(working copy)
@@ -351,6 +351,20 @@  avr_option_override (void)
 {
   flag_delete_null_pointer_checks = 0;
 
+  /* Avoid warning from 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;