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: Roger Sayle <roger at eyesopen dot com>
- To: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- Cc: law at redhat dot com, 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>
- Date: Wed, 24 Mar 2004 12:27:04 -0700 (MST)
- Subject: Re: PATCH - [tree-ssa] regrouping of expression tree for single multiply add.
On Wed, 24 Mar 2004, Joseph S. Myers wrote:
> 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.
Or simply just guard this transformation with a check for flag_wrapv.
Indeed -fwrapv is the default for the Intel and Microsoft compilers.