aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 247522b50e8..862f55f6240 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -7734,8 +7734,8 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
&& TREE_CODE (tem) == COND_EXPR
&& TREE_CODE (TREE_OPERAND (tem, 1)) == code
&& TREE_CODE (TREE_OPERAND (tem, 2)) == code
- && ! VOID_TYPE_P (TREE_OPERAND (tem, 1))
- && ! VOID_TYPE_P (TREE_OPERAND (tem, 2))
+ && ! VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (tem, 1)))
+ && ! VOID_TYPE_P (TREE_TYPE (TREE_OPERAND (tem, 2)))
&& (TREE_TYPE (TREE_OPERAND (TREE_OPERAND (tem, 1), 0))
== TREE_TYPE (TREE_OPERAND (TREE_OPERAND (tem, 2), 0)))
&& (! (INTEGRAL_TYPE_P (TREE_TYPE (tem))
@@ -13191,7 +13191,7 @@ tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p, int depth)
/* If the initializer is non-void, then it's a normal expression
that will be assigned to the slot. */
- if (!VOID_TYPE_P (t))
+ if (!VOID_TYPE_P (TREE_TYPE (t)))
return RECURSE (t);
/* Otherwise, the initializer sets the slot in some way. One common