]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/54220 ([avr] Potential stack corruption in naked functions...
authorSenthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Tue, 4 Sep 2012 09:21:20 +0000 (09:21 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Tue, 4 Sep 2012 09:21:20 +0000 (09:21 +0000)
Backport from 2012-09-04 mainline r190914
PR target/54220
* config/avr/avr.c (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): New
define to...
(avr_allocate_stack_slots_for_args): ...this new static function.

From-SVN: r190917

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

index fa648e15a9b87ab9c33122deb2735a3f317ab1fc..a4edd5c6b4a6a2b6a0975b706dc3caf87a0bbf16 100644 (file)
@@ -1,3 +1,12 @@
+2012-09-04  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
+
+       Backport from 2012-09-04 mainline r190914
+
+       PR target/54220
+       * config/avr/avr.c (TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS): New
+       define to...
+       (avr_allocate_stack_slots_for_args): ...this new static function.
+
 2012-09-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        Backported from mainline
index afba77909e9e0f78d17d843aa59be228a98e6e35..e60857980d8a3a45084dda8047d86bec4471f242 100644 (file)
@@ -94,6 +94,7 @@ static bool avr_hard_regno_scratch_ok (unsigned int);
 static unsigned int avr_case_values_threshold (void);
 static bool avr_frame_pointer_required_p (void);
 static bool avr_can_eliminate (const int, const int);
+static bool avr_allocate_stack_slots_for_args (void);
 static bool avr_class_likely_spilled_p (reg_class_t c);
 static rtx avr_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
                             const_tree, bool);
@@ -218,6 +219,9 @@ static const struct default_options avr_option_optimization_table[] =
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE avr_can_eliminate
 
+#undef TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS
+#define TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS avr_allocate_stack_slots_for_args
+
 #undef TARGET_CLASS_LIKELY_SPILLED_P
 #define TARGET_CLASS_LIKELY_SPILLED_P avr_class_likely_spilled_p
 
@@ -446,6 +450,16 @@ avr_regs_to_save (HARD_REG_SET *set)
   return count;
 }
 
+
+/* Implement `TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS' */
+
+static bool
+avr_allocate_stack_slots_for_args (void)
+{
+  return !cfun->machine->is_naked;
+}
+
+
 /* Return true if register FROM can be eliminated via register TO.  */
 
 bool