This is the mail archive of the
mailing list for the GCC project.
Re: PATCH - [tree-ssa] regrouping of expression tree for single multiply add.
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: law at redhat dot com
- Cc: Diego Novillo <dnovillo at redhat dot com>, Fariborz Jahanian <fjahanian at apple dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Roger Sayle <roger at eyesopen dot com>
- Date: Wed, 24 Mar 2004 19:31:55 +0000 (UTC)
- Subject: Re: PATCH - [tree-ssa] regrouping of expression tree for single multiply add.
- References: <200403241917.i2OJHonL011901@speedy.slc.redhat.com>
On Wed, 24 Mar 2004 email@example.com wrote:
> a * b * c * d which is implemented as (((a * b) * c) * d) can be
> profitably turned into (a * b) * (c * d).
As long as you flag the (c * d) as wrapping on overflow, for signed
integer multiplication, or at least don't subsequently optimize on the
presumption that it doesn't overflow. (Consider 1 * 0 * large * large
where large * large overflows.) We need those per-expression flags for
overflow behavior to do such optimizations safely.
Joseph S. Myers