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] Improved re-association of signed arithmetic


On 5/18/2012 4:27 PM, Ulrich Weigand wrote:

I finally got some time to look into this in detail.  The various special-
case transforms in associate_plusminus all transform a plus/minus expression
tree into either a single operand, a negated operand, or a single plus or
minus of two operands.  This is valid as long as we can prove that the
newly introduced expression can never overflow (if we're doing signed
arithmetic).

It's interesting to note that for Ada, reassociatin is allowed if there
are no overriiding parens, even if it would introduce an overflow (exception) that would not occur otherwise. However, I think I prefer
the C semantics!



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