From: Senthil Kumar Selvaraj Date: Tue, 4 Sep 2012 09:08:50 +0000 (+0000) Subject: re PR target/54220 ([avr] Potential stack corruption in naked functions at -O0) X-Git-Tag: upstream/12.2.0~74462 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cee8f252d70e664c198070ef60ddc15d06176dad;p=platform%2Fupstream%2Fgcc.git re PR target/54220 ([avr] Potential stack corruption in naked functions at -O0) 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: r190914 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d034c10..70aecdd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-09-04 Senthil Kumar Selvaraj + + 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-04 Christophe Lyon * config/arm/arm.c (arm_expand_builtin): Replace gen_rtx_CONST_INT diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index c1753300..bab13a4 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -700,6 +700,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. */ static bool @@ -11339,6 +11349,9 @@ avr_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, tree *arg, #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_WARN_FUNC_RETURN #define TARGET_WARN_FUNC_RETURN avr_warn_func_return