This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH - [tree-ssa] regrouping of expression tree for single multiply add.


On Wed, 24 Mar 2004 law@redhat.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
jsm@polyomino.org.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]