diff options
author | Ben Cheng <bccheng@google.com> | 2013-08-05 15:18:29 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2013-08-05 16:03:48 -0700 |
commit | 32fce3edda831e36ee484406c39dffbe0230f257 (patch) | |
tree | 733b1b5398304b260a4ee3d5d9b17da5038c5486 /gcc-4.8/gcc/expr.c | |
parent | e85b9ca2afe8edbb9fa99c6ce2cc4e52dce18c21 (diff) | |
download | toolchain_gcc-32fce3edda831e36ee484406c39dffbe0230f257.tar.gz toolchain_gcc-32fce3edda831e36ee484406c39dffbe0230f257.tar.bz2 toolchain_gcc-32fce3edda831e36ee484406c39dffbe0230f257.zip |
[4.8] Merge GCC 4.8.1
Change-Id: Ic8a60b7563f5172440fd40788605163a0cca6e30
Diffstat (limited to 'gcc-4.8/gcc/expr.c')
-rw-r--r-- | gcc-4.8/gcc/expr.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/gcc-4.8/gcc/expr.c b/gcc-4.8/gcc/expr.c index e3fb0b63b..2c5f21aa9 100644 --- a/gcc-4.8/gcc/expr.c +++ b/gcc-4.8/gcc/expr.c @@ -7563,6 +7563,15 @@ expand_expr_addr_expr_1 (tree exp, rtx target, enum machine_mode tmode, inner = TREE_OPERAND (exp, 0); break; + case COMPOUND_LITERAL_EXPR: + /* Allow COMPOUND_LITERAL_EXPR in initializers, if e.g. + rtl_for_decl_init is called on DECL_INITIAL with + COMPOUNT_LITERAL_EXPRs in it, they aren't gimplified. */ + if (modifier == EXPAND_INITIALIZER + && COMPOUND_LITERAL_EXPR_DECL (exp)) + return expand_expr_addr_expr_1 (COMPOUND_LITERAL_EXPR_DECL (exp), + target, tmode, modifier, as); + /* FALLTHRU */ default: /* If the object is a DECL, then expand it for its rtl. Don't bypass expand_expr, as that can have various side effects; LABEL_DECLs for @@ -8383,6 +8392,15 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, else expand_operands (treeop0, treeop1, NULL_RTX, &op1, &op0, EXPAND_NORMAL); + /* op0 and op1 might still be constant, despite the above + != INTEGER_CST check. Handle it. */ + if (GET_MODE (op0) == VOIDmode && GET_MODE (op1) == VOIDmode) + { + op0 = convert_modes (innermode, mode, op0, true); + op1 = convert_modes (innermode, mode, op1, false); + return REDUCE_BIT_FIELD (expand_mult (mode, op0, op1, + target, unsignedp)); + } goto binop3; } } @@ -8405,6 +8423,19 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, { expand_operands (treeop0, treeop1, NULL_RTX, &op0, &op1, EXPAND_NORMAL); + /* op0 and op1 might still be constant, despite the above + != INTEGER_CST check. Handle it. */ + if (GET_MODE (op0) == VOIDmode && GET_MODE (op1) == VOIDmode) + { + widen_mult_const: + op0 = convert_modes (innermode, mode, op0, zextend_p); + op1 + = convert_modes (innermode, mode, op1, + TYPE_UNSIGNED (TREE_TYPE (treeop1))); + return REDUCE_BIT_FIELD (expand_mult (mode, op0, op1, + target, + unsignedp)); + } temp = expand_widening_mult (mode, op0, op1, target, unsignedp, this_optab); return REDUCE_BIT_FIELD (temp); @@ -8417,9 +8448,14 @@ expand_expr_real_2 (sepops ops, rtx target, enum machine_mode tmode, op0 = expand_normal (treeop0); if (TREE_CODE (treeop1) == INTEGER_CST) op1 = convert_modes (innermode, mode, - expand_normal (treeop1), unsignedp); + expand_normal (treeop1), + TYPE_UNSIGNED (TREE_TYPE (treeop1))); else op1 = expand_normal (treeop1); + /* op0 and op1 might still be constant, despite the above + != INTEGER_CST check. Handle it. */ + if (GET_MODE (op0) == VOIDmode && GET_MODE (op1) == VOIDmode) + goto widen_mult_const; temp = expand_binop (mode, other_optab, op0, op1, target, unsignedp, OPTAB_LIB_WIDEN); hipart = gen_highpart (innermode, temp); |