diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-28 04:13:48 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-28 04:13:48 +0000 |
commit | 63c8163c82c1d659dbd86a04e92e06ebd650bbb5 (patch) | |
tree | 3915ff408e9fa298c376c39db25e09c6a1cc70f2 /gcc/expr.c | |
parent | d386090f0156581081bb867b4b7ffb29d9b969e0 (diff) | |
download | ppe42-gcc-63c8163c82c1d659dbd86a04e92e06ebd650bbb5.tar.gz ppe42-gcc-63c8163c82c1d659dbd86a04e92e06ebd650bbb5.zip |
* expr.c (expand_expr <COMPLEX_CST, STRING_CST>): Always call
output_constant_def, use its result instead of TREE_CST_RTL (exp).
Can assume it has the form (mem (symbol_ref ".LCxxx")).
(expand_expr <COMPONENT_REF>): Can always just extract the
relevant field of a CONSTRUCTOR.
(expand_expr <ARRAY_REF, COMPONENT_REF, BIT_FIELD_REF,
ARRAY_RANGE_REF>): Make control flow explicit.
* varasm.c (output_constant_def): Can look at TREE_CST_RTL of
an INTEGER_CST.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66148 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 6488a8088b3..0d6118778b8 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6872,22 +6872,19 @@ expand_expr (exp, target, tmode, modifier) case COMPLEX_CST: case STRING_CST: - if (! TREE_CST_RTL (exp)) - output_constant_def (exp, 1); + temp = output_constant_def (exp, 1); - /* TREE_CST_RTL probably contains a constant address. + /* temp contains a constant address. On RISC machines where a constant address isn't valid, make some insns to get that address into a register. */ - if (GET_CODE (TREE_CST_RTL (exp)) == MEM - && modifier != EXPAND_CONST_ADDRESS + if (modifier != EXPAND_CONST_ADDRESS && modifier != EXPAND_INITIALIZER && modifier != EXPAND_SUM - && (! memory_address_p (mode, XEXP (TREE_CST_RTL (exp), 0)) - || (flag_force_addr - && GET_CODE (XEXP (TREE_CST_RTL (exp), 0)) != REG))) - return replace_equiv_address (TREE_CST_RTL (exp), - copy_rtx (XEXP (TREE_CST_RTL (exp), 0))); - return TREE_CST_RTL (exp); + && (! memory_address_p (mode, XEXP (temp, 0)) + || flag_force_addr)) + return replace_equiv_address (temp, + copy_rtx (XEXP (temp, 0))); + return temp; case EXPR_WITH_FILE_LOCATION: { @@ -7300,18 +7297,12 @@ expand_expr (exp, target, tmode, modifier) } } } - /* Fall through. */ + goto normal_inner_ref; case COMPONENT_REF: - case BIT_FIELD_REF: - case ARRAY_RANGE_REF: /* If the operand is a CONSTRUCTOR, we can just extract the - appropriate field if it is present. Don't do this if we have - already written the data since we want to refer to that copy - and varasm.c assumes that's what we'll do. */ - if (code == COMPONENT_REF - && TREE_CODE (TREE_OPERAND (exp, 0)) == CONSTRUCTOR - && TREE_CST_RTL (TREE_OPERAND (exp, 0)) == 0) + appropriate field if it is present. */ + if (TREE_CODE (TREE_OPERAND (exp, 0)) == CONSTRUCTOR) { tree elt; @@ -7363,7 +7354,11 @@ expand_expr (exp, target, tmode, modifier) return op0; } } + goto normal_inner_ref; + case BIT_FIELD_REF: + case ARRAY_RANGE_REF: + normal_inner_ref: { enum machine_mode mode1; HOST_WIDE_INT bitsize, bitpos; |