diff options
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r-- | gcc/cfgexpand.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 8ff79abf691..7df9d06fab3 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1335,7 +1335,16 @@ expand_one_var (tree var, bool toplevel, bool really_expand) else { if (really_expand) - expand_one_stack_var (origvar); + { + if (lookup_attribute ("naked", + DECL_ATTRIBUTES (current_function_decl))) + error ("cannot allocate stack for variable %q+D, naked function.", + var); + + expand_one_stack_var (origvar); + } + + return tree_to_uhwi (DECL_SIZE_UNIT (var)); } return 0; |