===================================================================
@@ -561,9 +578,10 @@ (define_operator_list swapped_tcc_compar
&& !TYPE_OVERFLOW_SANITIZED (type))
(convert @1)))
- /* We can't reassociate floating-point or fixed-point plus or minus
- because of saturation to +-Inf. */
- (if (!FLOAT_TYPE_P (type) && !FIXED_POINT_TYPE_P (type))
+ /* We can't reassociate floating-point unless -fassociative-math
+ or fixed-point plus or minus because of saturation to +-Inf. */
+ (if ((!FLOAT_TYPE_P (type) || flag_associative_math)
+ && !FIXED_POINT_TYPE_P (type))
/* Match patterns that allow contracting a plus-minus pair
irrespective of overflow issues. */