(with { tree cst = const_binop (outer_op == inner_op
? PLUS_EXPR : MINUS_EXPR,
type, @1, @2); }
- (if (cst && !TREE_OVERFLOW (cst))
- (inner_op @0 { cst; } )
- /* X+INT_MAX+1 is X-INT_MIN. */
- (if (INTEGRAL_TYPE_P (type) && cst
- && wi::to_wide (cst) == wi::min_value (type))
- (neg_inner_op @0 { wide_int_to_tree (type, wi::to_wide (cst)); })
- /* Last resort, use some unsigned type. */
- (with { tree utype = unsigned_type_for (type); }
- (if (utype)
- (view_convert (inner_op
- (view_convert:utype @0)
- (view_convert:utype
- { drop_tree_overflow (cst); }))))))))))))))
+ (if (cst)
+ (if (INTEGRAL_TYPE_P (type) && !TREE_OVERFLOW (cst))
+ (inner_op @0 { cst; } )
+ /* X+INT_MAX+1 is X-INT_MIN. */
+ (if (INTEGRAL_TYPE_P (type)
+ && wi::to_wide (cst) == wi::min_value (type))
+ (neg_inner_op @0 { wide_int_to_tree (type, wi::to_wide (cst)); })
+ /* Last resort, use some unsigned type. */
+ (with { tree utype = unsigned_type_for (type); }
+ (if (utype)
+ (view_convert (inner_op
+ (view_convert:utype @0)
+ (view_convert:utype
+ { TREE_OVERFLOW (cst)
+ ? drop_tree_overflow (cst) : cst; })))))))))))))))
/* (CST1 - A) +- CST2 -> CST3 - A */
(for outer_op (plus minus)
*v2 = (c1-*v2)+c2;
}
-/* { dg-final { scan-tree-dump-not "\\\+" "forwprop1"} } */
+/* { dg-final { scan-tree-dump-times "\\\+" 1 "forwprop1"} } */
/* { dg-final { scan-tree-dump "{ 0, 4 }" "forwprop1"} } */
/* { dg-final { scan-tree-dump "{ 37, -5 }" "forwprop1"} } */
+/* { dg-final { scan-tree-dump "{ 27, 23 }" "forwprop1"} } */
+/* { dg-final { scan-tree-dump "{ 37, 3 }" "forwprop1"} } */
#define TYPE_REF_CAN_ALIAS_ALL(NODE) \
(PTR_OR_REF_CHECK (NODE)->base.static_flag)
-/* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
+/* In an INTEGER_CST, REAL_CST, or COMPLEX_CST, this means
there was an overflow in folding. */
#define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->base.public_flag)