aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2003-10-06 23:11:21 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2003-10-06 23:11:21 +0000
commitc37b68d42af9dfe0561541be06879f6cdb0f0532 (patch)
treeace214380ff13e173e7c33913c705ff6975fa7a3 /gcc/expr.c
parent37bf20eeb00f4cb848b2533b037c101964ac3c4b (diff)
downloadgcc-c37b68d42af9dfe0561541be06879f6cdb0f0532.zip
gcc-c37b68d42af9dfe0561541be06879f6cdb0f0532.tar.gz
gcc-c37b68d42af9dfe0561541be06879f6cdb0f0532.tar.bz2
expr.c (expand_expr <COND_EXPR>): Handle the void type semantics of COND_EXPR when expanding the "A op 0 ? FOO ...
* expr.c (expand_expr <COND_EXPR>): Handle the void type semantics of COND_EXPR when expanding the "A op 0 ? FOO : A" optimizations. From-SVN: r72172
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 26eaab0..edc4290 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8910,8 +8910,12 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
jumpif (TREE_OPERAND (exp, 0), op0);
start_cleanup_deferral ();
- store_expr (TREE_OPERAND (exp, 2), temp,
- modifier == EXPAND_STACK_PARM ? 2 : 0);
+ if (TREE_TYPE (TREE_OPERAND (exp, 2)) != void_type_node)
+ store_expr (TREE_OPERAND (exp, 2), temp,
+ modifier == EXPAND_STACK_PARM ? 2 : 0);
+ else
+ expand_expr (TREE_OPERAND (exp, 2),
+ ignore ? const0_rtx : NULL_RTX, VOIDmode, 0);
op1 = op0;
}
else if (temp
@@ -8931,8 +8935,12 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
jumpifnot (TREE_OPERAND (exp, 0), op0);
start_cleanup_deferral ();
- store_expr (TREE_OPERAND (exp, 1), temp,
- modifier == EXPAND_STACK_PARM ? 2 : 0);
+ if (TREE_TYPE (TREE_OPERAND (exp, 1)) != void_type_node)
+ store_expr (TREE_OPERAND (exp, 1), temp,
+ modifier == EXPAND_STACK_PARM ? 2 : 0);
+ else
+ expand_expr (TREE_OPERAND (exp, 1),
+ ignore ? const0_rtx : NULL_RTX, VOIDmode, 0);
op1 = op0;
}
else