From: Richard Henderson Date: Sat, 11 Sep 2004 17:48:22 +0000 (-0700) Subject: * expr.c (expand_expr_addr_expr_1) Rename from expand_expr_addr_expr. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=70bb498ad4fcb4c3e502b770ab848334e0730b39;p=gcc.git * expr.c (expand_expr_addr_expr_1) Rename from expand_expr_addr_expr. (expand_expr_addr_expr): New function. Take ADDR_EXPR instead of the operand of the ADDR_EXPR. (expand_expr_real_1): Update to match. From-SVN: r87355 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e01779a5d46..80d1437f056 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-09-11 Richard Henderson + + * expr.c (expand_expr_addr_expr_1) Rename from expand_expr_addr_expr. + (expand_expr_addr_expr): New function. Take ADDR_EXPR instead of the + operand of the ADDR_EXPR. + (expand_expr_real_1): Update to match. + 2004-09-11 David Edelsohn PR target/17277 diff --git a/gcc/expr.c b/gcc/expr.c index 44f485b32d4..83c8be5240f 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6048,12 +6048,12 @@ expand_operands (tree exp0, tree exp1, rtx target, rtx *op0, rtx *op1, } -/* A subroutine of expand_expr. Evaluate the address of EXP. +/* A subroutine of expand_expr_addr_expr. Evaluate the address of EXP. The TARGET, TMODE and MODIFIER arguments are as for expand_expr. */ static rtx -expand_expr_addr_expr (tree exp, rtx target, enum machine_mode tmode, - enum expand_modifier modifier) +expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, + enum expand_modifier modifier) { rtx result, subtarget; tree inner, offset; @@ -6080,7 +6080,7 @@ expand_expr_addr_expr (tree exp, rtx target, enum machine_mode tmode, case CONST_DECL: /* Recurse and make the output_constant_def clause above handle this. */ - return expand_expr_addr_expr (DECL_INITIAL (exp), target, + return expand_expr_addr_expr_1 (DECL_INITIAL (exp), target, tmode, modifier); case REALPART_EXPR: @@ -6140,7 +6140,7 @@ expand_expr_addr_expr (tree exp, rtx target, enum machine_mode tmode, gcc_assert (inner != exp); subtarget = offset || bitpos ? NULL_RTX : target; - result = expand_expr_addr_expr (inner, subtarget, tmode, modifier); + result = expand_expr_addr_expr_1 (inner, subtarget, tmode, modifier); if (tmode == VOIDmode) { @@ -6181,6 +6181,33 @@ expand_expr_addr_expr (tree exp, rtx target, enum machine_mode tmode, return result; } +/* A subroutine of expand_expr. Evaluate EXP, which is an ADDR_EXPR. + The TARGET, TMODE and MODIFIER arguments are as for expand_expr. */ + +static rtx +expand_expr_addr_expr (tree exp, rtx target, enum machine_mode tmode, + enum expand_modifier modifier) +{ + enum machine_mode rmode; + rtx result; + + result = expand_expr_addr_expr_1 (TREE_OPERAND (exp, 0), target, + tmode, modifier); + + /* Despite expand_expr claims concerning ignoring TMODE when not + strictly convenient, stuff breaks if we don't honor it. */ + if (tmode == VOIDmode) + tmode = TYPE_MODE (TREE_TYPE (exp)); + rmode = GET_MODE (result); + if (rmode == VOIDmode) + rmode = tmode; + if (rmode != tmode) + result = convert_memory_address (tmode, result); + + return result; +} + + /* expand_expr: generate code for computing expression EXP. An rtx for the computed value is returned. The value is never null. In the case of a void EXP, const0_rtx is returned. @@ -8064,8 +8091,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, return const0_rtx; case ADDR_EXPR: - return expand_expr_addr_expr (TREE_OPERAND (exp, 0), target, - tmode, modifier); + return expand_expr_addr_expr (exp, target, tmode, modifier); /* COMPLEX type for Extended Pascal & Fortran */ case COMPLEX_EXPR: