diff options
author | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-17 00:18:44 +0000 |
---|---|---|
committer | kenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-17 00:18:44 +0000 |
commit | 99c75e8851f11cbb8acdc34ef0045068c1169a24 (patch) | |
tree | 22007ec64d1ed8a75a584fdbb4dc6fbe487786c0 /gcc/expr.c | |
parent | 3522d2dd2c0f7f80df148a00b97d095eb86511f1 (diff) | |
download | gcc-99c75e8851f11cbb8acdc34ef0045068c1169a24.tar.gz |
* expr.c (expand_expr, case ADDR_EXPR): If taking address of SAVE_EXPR,
use put_var_into_stack.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43423 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 96665688643..230cf9f1e6e 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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) |