Do C++ signed types have modulo semantics?

Daniel Berlin dberlin@dberlin.org
Tue Jun 28 17:08:00 GMT 2005



On Tue, 28 Jun 2005, Mark Mitchell wrote:

> Joe Buck wrote:
>
>> I don't think we should give the user any such promise, and if we do
>> give such a promise, we will never catch icc.  The main problem is that
>> we will no longer be able to optimize many loops.
>
> It's entirely possible that I was naive in assuming that this wouldn't have a 
> big optimization impact.  Reiterating my response to Daniel, if it is in fact 
> the case that this is a major loss for optimization, then I would have to 
> retract my claim.

I've got some notes in to various XLC people to get info if they have 
actual numbers.

However, in the meanwhile, the manual actually says it causes very severe 
performance 
degradation, and that you are better off doing -O2 and 
-qnostrict_induction than -O3 + qstrict_induction, if it makes your code 
work.

(which means it says you are better off turning off high level loop opts 
like interchange/fusion/etc and still letting lower level stuff make the 
assumption, than you are turning off the assumption and turning on high 
level loop opts).

I imagine it very badly degrades your ability to move things out of loops, 
perform any kind of cache transformations, etc.

and it's just so common to write signed loops without caring about 
overflow that i'd guess you lose 90% of your opportunities to do anything 
useful or cool with the loop.



More information about the Gcc mailing list