===================================================================
@@ -3125,9 +3125,8 @@ omit_two_operands_loc (location_t loc, t
problems with the dominator optimizer. */
static tree
-fold_truth_not_expr (location_t loc, tree arg)
+fold_truth_not_expr (location_t loc, tree type, tree arg)
{
- tree type = TREE_TYPE (arg);
enum tree_code code = TREE_CODE (arg);
location_t loc1, loc2;
@@ -8108,10 +8107,7 @@ fold_unary_loc (location_t loc, enum tre
and its values must be 0 or 1.
("true" is a fixed value perhaps depending on the language,
but we don't handle values other than 1 correctly yet.) */
- tem = fold_truth_not_expr (loc, arg0);
- if (!tem)
- return NULL_TREE;
- return fold_convert_loc (loc, type, tem);
+ return fold_truth_not_expr (loc, type, arg0);
case REALPART_EXPR:
if (TREE_CODE (TREE_TYPE (arg0)) != COMPLEX_TYPE)
@@ -12628,16 +12624,12 @@ fold_binary_loc (location_t loc,
/* bool_var != 1 becomes !bool_var. */
if (TREE_CODE (TREE_TYPE (arg0)) == BOOLEAN_TYPE && integer_onep (arg1)
&& code == NE_EXPR)
- return fold_convert_loc (loc, type,
- fold_build1_loc (loc, TRUTH_NOT_EXPR,
- TREE_TYPE (arg0), arg0));
+ return fold_build1_loc (loc, TRUTH_NOT_EXPR, type, arg0);
/* bool_var == 0 becomes !bool_var. */
if (TREE_CODE (TREE_TYPE (arg0)) == BOOLEAN_TYPE && integer_zerop (arg1)
&& code == EQ_EXPR)
- return fold_convert_loc (loc, type,
- fold_build1_loc (loc, TRUTH_NOT_EXPR,
- TREE_TYPE (arg0), arg0));
+ return fold_build1_loc (loc, TRUTH_NOT_EXPR, type, arg0);
/* !exp != 0 becomes !exp */
if (TREE_CODE (arg0) == TRUTH_NOT_EXPR && integer_zerop (arg1)