expr.c (expand_expr, [...]): If taking address of SAVE_EXPR, use put_var_into_stack.
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Sun, 17 Jun 2001 00:18:44 +0000 (00:18 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 17 Jun 2001 00:18:44 +0000 (20:18 -0400)
* expr.c (expand_expr, case ADDR_EXPR): If taking address of SAVE_EXPR,
use put_var_into_stack.

From-SVN: r43423

gcc/ChangeLog
gcc/expr.c

index 65f241aac1aabcb7c69d8aa8414d4f7bda731225..e0092a4900b089972e89ce2f238aa6351bbb3d2f 100644 (file)
@@ -1,3 +1,8 @@
+Sat Jun 16 20:20:39 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * expr.c (expand_expr, case ADDR_EXPR): If taking address of SAVE_EXPR,
+       use put_var_into_stack.
+
 2001-06-16  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
        * gccspec.c (lang_specific_driver): If compiling ObjC, add
index 966656886430960ed1abc0cdeaf74e9990934125..230cf9f1e6e498e6605aed598e7b4f6217f480f8 100644 (file)
@@ -7034,14 +7034,22 @@ expand_expr (exp, target, tmode, modifier)
            if (GET_CODE (op0) == REG || GET_CODE (op0) == SUBREG
                || GET_CODE (op0) == CONCAT || GET_CODE (op0) == ADDRESSOF)
              {
-               tree nt = build_qualified_type (TREE_TYPE (tem),
-                                               (TYPE_QUALS (TREE_TYPE (tem))
-                                                | TYPE_QUAL_CONST));
-               rtx memloc = assign_temp (nt, 1, 1, 1);
+               /* If the operand is a SAVE_EXPR, we can deal with this by
+                  forcing the SAVE_EXPR into memory.  */
+               if (TREE_CODE (TREE_OPERAND (exp, 0)) == SAVE_EXPR)
+                 put_var_into_stack (TREE_OPERAND (exp, 0));
+               else
+                 {
+                   tree nt
+                     = build_qualified_type (TREE_TYPE (tem),
+                                             (TYPE_QUALS (TREE_TYPE (tem))
+                                              | TYPE_QUAL_CONST));
+                   rtx memloc = assign_temp (nt, 1, 1, 1);
 
-               mark_temp_addr_taken (memloc);
-               emit_move_insn (memloc, op0);
-               op0 = memloc;
+                   mark_temp_addr_taken (memloc);
+                   emit_move_insn (memloc, op0);
+                   op0 = memloc;
+                 }
              }
 
            if (GET_CODE (op0) != MEM)