diff options
author | Richard Henderson <rth@redhat.com> | 2002-02-08 14:20:16 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-02-08 14:20:16 -0800 |
commit | fdf473ae1b7e9b775418aa69918641dd651d0150 (patch) | |
tree | 9c571efba5f72e86224f8701d8dd1487d6780ced /gcc/expr.c | |
parent | 30d287947efab771a850c16a1fb60fc65b2ae148 (diff) | |
download | gcc-fdf473ae1b7e9b775418aa69918641dd651d0150.zip gcc-fdf473ae1b7e9b775418aa69918641dd651d0150.tar.gz gcc-fdf473ae1b7e9b775418aa69918641dd651d0150.tar.bz2 |
expr.c (expand_expr): Mind EXPAND_INITIALIZER for truncation also.
* expr.c (expand_expr): Mind EXPAND_INITIALIZER for truncation also.
* final.c (output_addr_const): Accept and discard SUBREG.
* varasm.c (decode_addr_const): Don't abort on unknown expressions --
mark them unknown instead.
(simplify_subtraction): Handle RTX_UNKNOWN.
(initializer_constant_valid_p): Strip NOP_EXPRs that narrow the mode.
* gcc.c-torture/compile/labels-3.c: New.
From-SVN: r49622
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -7274,15 +7274,24 @@ expand_expr (exp, target, tmode, modifier) return op0; } - op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, 0); + op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, mode, modifier); if (GET_MODE (op0) == mode) return op0; /* If OP0 is a constant, just convert it into the proper mode. */ if (CONSTANT_P (op0)) - return - convert_modes (mode, TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0))), - op0, TREE_UNSIGNED (TREE_TYPE (TREE_OPERAND (exp, 0)))); + { + tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0)); + enum machine_mode inner_mode = TYPE_MODE (inner_type); + + if (modifier == EXPAND_INITIALIZER) + return simplify_gen_subreg (mode, op0, inner_mode, + subreg_lowpart_offset (mode, + inner_mode)); + else + return convert_modes (mode, inner_mode, op0, + TREE_UNSIGNED (inner_type)); + } if (modifier == EXPAND_INITIALIZER) return gen_rtx_fmt_e (unsignedp ? ZERO_EXTEND : SIGN_EXTEND, mode, op0); |