This is the mail archive of the 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] Fix bug in fold_div_compare

On Wed, 18 Oct 2006, Eric Botcazou wrote:
> > 2006-10-10  Eric Botcazou  <>
> >
> > 	* fold-const.c (add_double): Rename to add_double_with_sign.
> > 	Add 'unsigned_p' parameter and take it into account for the overflow.
> > 	(mul_double): Rename to mul_double_with_sign.
> > 	Add 'unsigned_p' parameter and take it into account for the overflow.
> > 	(fold_div_compare): Call add_double_with_sign instead of add_double
> > 	and mul_double_with_sign instead of mul_double, passing them the
> > 	unsignedness of the type.
> > 	* tree.h (add_double): Macroize.
> > 	(add_double_with_sign): New prototype.
> > 	(mul_double): Macroize.
> > 	(mul_double_with_sign): New prototype.
> Ping:

Sorry, I appear to have missed this one the first time around.

I approve of the foo_with_sign forms of these functions to allow
detection of both signed and unsigned overflow.  This is an aspect
of some ongoing TREE_OVERFLOW clean-ups I have waiting for stage 1,
but given you've identified a regression, your changes are suitable
for stage 3.

Presumably, you've now managed to complete more than "moderate"
testing, such as a full bootstrap and regression test with no new
failures.  If so, this is OK for mainline.

I appreciate you're not a huge fan of my preference of applying
patches first to mainline, and backporting them to the release
branches once they've been demonstrated to be safe on several
platforms.  However it's still a policy that I believe in, so
unless you've a strong objection I'll conditionally approve this
patch for the 4.0 and 4.1 branches after a few days on mainline
without problems *and* complete bootstrap and regression testing
on each affected branch.

Thanks for fixing this.  This part of the middle-end is a mess, and
I'm sorry that it's bitten you before before being cleaned up.  With
your fix, we're now a step closer to eliminating the TYPE_IS_SIZETYPE
special case code in GCC's type system.


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