Commit afc6aaab by Zack Weinberg Committed by Zack Weinberg

expr.c (expand_expr <COMPLEX_CST, [...]): Always call output_constant_def, use…

expr.c (expand_expr <COMPLEX_CST, [...]): Always call output_constant_def, use its result instead of TREE_CST_RTL (exp).

        * 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.

From-SVN: r66148
parent 73c4dcc6
2003-04-27 Zack Weinberg <zack@codesourcery.com>
* 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.
2003-04-27 Kazu Hirata <kazu@cs.umass.edu> 2003-04-27 Kazu Hirata <kazu@cs.umass.edu>
* reload1.c (reg_set_luid): Fix a comment typo. * reload1.c (reg_set_luid): Fix a comment typo.
......
...@@ -6872,22 +6872,19 @@ expand_expr (exp, target, tmode, modifier) ...@@ -6872,22 +6872,19 @@ expand_expr (exp, target, tmode, modifier)
case COMPLEX_CST: case COMPLEX_CST:
case STRING_CST: case STRING_CST:
if (! TREE_CST_RTL (exp)) temp = output_constant_def (exp, 1);
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, On RISC machines where a constant address isn't valid,
make some insns to get that address into a register. */ make some insns to get that address into a register. */
if (GET_CODE (TREE_CST_RTL (exp)) == MEM if (modifier != EXPAND_CONST_ADDRESS
&& modifier != EXPAND_CONST_ADDRESS
&& modifier != EXPAND_INITIALIZER && modifier != EXPAND_INITIALIZER
&& modifier != EXPAND_SUM && modifier != EXPAND_SUM
&& (! memory_address_p (mode, XEXP (TREE_CST_RTL (exp), 0)) && (! memory_address_p (mode, XEXP (temp, 0))
|| (flag_force_addr || flag_force_addr))
&& GET_CODE (XEXP (TREE_CST_RTL (exp), 0)) != REG))) return replace_equiv_address (temp,
return replace_equiv_address (TREE_CST_RTL (exp), copy_rtx (XEXP (temp, 0)));
copy_rtx (XEXP (TREE_CST_RTL (exp), 0))); return temp;
return TREE_CST_RTL (exp);
case EXPR_WITH_FILE_LOCATION: case EXPR_WITH_FILE_LOCATION:
{ {
...@@ -7300,18 +7297,12 @@ expand_expr (exp, target, tmode, modifier) ...@@ -7300,18 +7297,12 @@ expand_expr (exp, target, tmode, modifier)
} }
} }
} }
/* Fall through. */ goto normal_inner_ref;
case COMPONENT_REF: case COMPONENT_REF:
case BIT_FIELD_REF:
case ARRAY_RANGE_REF:
/* If the operand is a CONSTRUCTOR, we can just extract the /* If the operand is a CONSTRUCTOR, we can just extract the
appropriate field if it is present. Don't do this if we have appropriate field if it is present. */
already written the data since we want to refer to that copy if (TREE_CODE (TREE_OPERAND (exp, 0)) == CONSTRUCTOR)
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)
{ {
tree elt; tree elt;
...@@ -7363,7 +7354,11 @@ expand_expr (exp, target, tmode, modifier) ...@@ -7363,7 +7354,11 @@ expand_expr (exp, target, tmode, modifier)
return op0; return op0;
} }
} }
goto normal_inner_ref;
case BIT_FIELD_REF:
case ARRAY_RANGE_REF:
normal_inner_ref:
{ {
enum machine_mode mode1; enum machine_mode mode1;
HOST_WIDE_INT bitsize, bitpos; HOST_WIDE_INT bitsize, bitpos;
......
...@@ -2567,7 +2567,7 @@ output_constant_def (exp, defer) ...@@ -2567,7 +2567,7 @@ output_constant_def (exp, defer)
/* We can't just use the saved RTL if this is a deferred string constant /* We can't just use the saved RTL if this is a deferred string constant
and we are not to defer anymore. */ and we are not to defer anymore. */
if (TREE_CODE (exp) != INTEGER_CST && TREE_CST_RTL (exp) if (TREE_CST_RTL (exp)
&& (defer || !STRING_POOL_ADDRESS_P (XEXP (TREE_CST_RTL (exp), 0)))) && (defer || !STRING_POOL_ADDRESS_P (XEXP (TREE_CST_RTL (exp), 0))))
return TREE_CST_RTL (exp); return TREE_CST_RTL (exp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment