diff options
Diffstat (limited to 'gcc/expr.c')
-rw-r--r-- | gcc/expr.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/gcc/expr.c b/gcc/expr.c index 7182b574423..05bb9b80f6c 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6247,6 +6247,9 @@ safe_from_p (rtx x, tree exp, int top_p) case tcc_type: /* Should never get a type here. */ gcc_unreachable (); + + case tcc_gimple_stmt: + gcc_unreachable (); } /* If we have an rtl, find any enclosed object. Then see if we conflict @@ -6667,7 +6670,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode, /* Handle ERROR_MARK before anybody tries to access its type. */ if (TREE_CODE (exp) == ERROR_MARK - || TREE_CODE (TREE_TYPE (exp)) == ERROR_MARK) + || (!GIMPLE_TUPLE_P (exp) && TREE_CODE (TREE_TYPE (exp)) == ERROR_MARK)) { ret = CONST0_RTX (tmode); return ret ? ret : const0_rtx; @@ -6737,7 +6740,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier modifier, rtx *alt_rtl) { rtx op0, op1, temp, decl_rtl; - tree type = TREE_TYPE (exp); + tree type; int unsignedp; enum machine_mode mode; enum tree_code code = TREE_CODE (exp); @@ -6752,8 +6755,18 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, type) \ : (expr)) - mode = TYPE_MODE (type); - unsignedp = TYPE_UNSIGNED (type); + if (GIMPLE_STMT_P (exp)) + { + type = void_type_node; + mode = VOIDmode; + unsignedp = 0; + } + else + { + type = TREE_TYPE (exp); + mode = TYPE_MODE (type); + unsignedp = TYPE_UNSIGNED (type); + } if (lang_hooks.reduce_bit_field_operations && TREE_CODE (type) == INTEGER_TYPE && GET_MODE_PRECISION (mode) > TYPE_PRECISION (type)) @@ -8563,10 +8576,10 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, target = expand_vec_cond_expr (exp, target); return target; - case MODIFY_EXPR: + case GIMPLE_MODIFY_STMT: { - tree lhs = TREE_OPERAND (exp, 0); - tree rhs = TREE_OPERAND (exp, 1); + tree lhs = GIMPLE_STMT_OPERAND (exp, 0); + tree rhs = GIMPLE_STMT_OPERAND (exp, 1); gcc_assert (ignore); |