From: Nick Clifton Date: Wed, 10 Aug 2011 09:05:33 +0000 (+0000) Subject: expr.c (expand_expr_addr_expr_1): Detect a user request for a local frame in a naked... X-Git-Tag: releases/gcc-4.5.4~485 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5c6b3c7b47e738434d6841f53eea43a2d7bd923;p=thirdparty%2Fgcc.git expr.c (expand_expr_addr_expr_1): Detect a user request for a local frame in a naked function... * expr.c (expand_expr_addr_expr_1): Detect a user request for a local frame in a naked function, and produce a suitable error for that specific case. From-SVN: r177617 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf4407de4e72..0e0a13e1e8dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-08-10 DJ Delorie + + * expr.c (expand_expr_addr_expr_1): Detect a user request for + a local frame in a naked function, and produce a suitable + error for that specific case. + 2011-08-06 Uros Bizjak PR target/50001 @@ -51,6 +57,11 @@ * config/i386/i386.md (strlensi): Enable for !TARGET_64BIT only. (strlendi): Enable for TARGET_64BIT only. +2011-07-29 Nick Clifton + + * config/rx/rx.c (rx_expand_builtin): Fix typo checking the setpsw + builtin. + 2011-07-19 Jakub Jelinek Backport from mainline diff --git a/gcc/expr.c b/gcc/expr.c index e0384542460a..4d05c6171162 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6906,6 +6906,14 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, modifier == EXPAND_INITIALIZER ? EXPAND_INITIALIZER : EXPAND_CONST_ADDRESS); + if (TREE_ADDRESSABLE (exp) + && ! MEM_P (result) + && ! targetm.calls.allocate_stack_slots_for_args ()) + { + error ("local frame unavailable (naked function?)"); + return result; + } + /* If the DECL isn't in memory, then the DECL wasn't properly marked TREE_ADDRESSABLE, which will be either a front-end or a tree optimizer bug. */