This is the mail archive of the gcc@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: Do C++ signed types have modulo semantics?


On Tuesday 28 June 2005 14:16, Paul Koning wrote:
> >>>>> "Steven" == Steven Bosscher <stevenb@suse.de> writes:
>
>  Steven> Indeed.  Frankly this "seems likely" guess confuses me.  It
>  Steven> is already well known that using unsigned types for loop
>  Steven> counters may greatly improve the code gcc can generate for
>  Steven> loops.  With wrap-around semantics, suddenly countable loops
>  Steven> are turned into noncountable loops, overflow can occur,
>  Steven> dependencies may be introduced that never happen in reality,
>  Steven> and so on.
>
> I must be missing something.

Yes.

> Unsigned has wraparound (modulo) 
> semantics.

The whole point is that it doesn't.

Gr.
Steven


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