Commit 21403f14 by Richard Kenner

(fold): When converting a COND_EXPR to an ABS_EXPR, get the types

right for ABS_EXPR to work.

From-SVN: r9939
parent dbfac751
......@@ -4854,12 +4854,16 @@ fold (expr)
case GE_EXPR:
case GT_EXPR:
return pedantic_non_lvalue
(fold (build1 (ABS_EXPR, type, arg1)));
(convert (type, fold (build1 (ABS_EXPR,
TREE_TYPE (arg1), arg1))));
case LE_EXPR:
case LT_EXPR:
return pedantic_non_lvalue
(fold (build1 (NEGATE_EXPR, type,
fold (build1 (ABS_EXPR, type, arg1)))));
convert (type,
fold (build1 (ABS_EXPR,
TREE_TYPE (arg1),
arg1))))));
}
/* If this is A != 0 ? A : 0, this is simply A. For ==, it is
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment