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, 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.

Roger
--


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