This is the mail archive of the
mailing list for the GCC project.
Re: Patch gcc-4.0 should not apply mathematical associative rules for addition or multiplication
Richard Henderson <email@example.com> writes:
| On Wed, Oct 06, 2004 at 05:05:08PM -0700, Fariborz Jahanian wrote:
| > * tree-ssa-dom.c (unsafe_associative_fp_binop): New function.
| > (simplify_rhs_and_lookup_avail_expr): Disallow associativity
| > and constant folding of floating point MULT_EXPR/PLUS_EXPR
| > expressions.
| If you apply this, I'll immediately file a PR for a regression
| and assign it to you.
| You should allow
| X op C1 op C2
| to combine to
| X op C3
| if C1 op C2 is exactly representable.
Only if C3 does not overflow, which is the root of the issue why this
transformation is unsafe in general.