]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
expr.c (expand_expr_addr_expr_1): Detect a user request for a local frame in a naked...
authorNick Clifton <nickc@gcc.gnu.org>
Wed, 10 Aug 2011 09:05:33 +0000 (09:05 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Wed, 10 Aug 2011 09:05:33 +0000 (09:05 +0000)
* 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

gcc/ChangeLog
gcc/expr.c

index bf4407de4e72d38cf0e203be51fd003f358af9e8..0e0a13e1e8dc7eb678288a54b45d36d1e7f4eb7b 100644 (file)
@@ -1,3 +1,9 @@
+2011-08-10  DJ Delorie  <dj@redhat.com>
+
+       * 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  <ubizjak@gmail.com>
 
        PR target/50001
        * config/i386/i386.md (strlensi): Enable for !TARGET_64BIT only.
        (strlendi): Enable for TARGET_64BIT only.
 
+2011-07-29  Nick Clifton  <nickc@redhat.com>
+
+       * config/rx/rx.c (rx_expand_builtin): Fix typo checking the setpsw
+       builtin.
+
 2011-07-19  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
index e0384542460ac02c827aecf26ccbb2c49fe58d89..4d05c617116295f058091fffc8008ab740790c15 100644 (file)
@@ -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.  */