Integer overflow and underflow semantics

Alex Rønne Petersen xtzgzorex at gmail.com
Mon May 14 05:59:36 PDT 2012


On 05-05-2012 06:57, Alex Rønne Petersen wrote:
> Hi,
>
> I don't think the language really makes it clear whether overflows and
> underflows are well-defined. Do we guarantee that for any integral type
> T, T.max + 1 == T.min and T.min - 1 == T.max?
>
> This is relevant in particular for GDC and LDC since they target a lot
> of weird architectures.
>

Bumping this as we still need to make a decision about this. As recently 
as yesterday, someone on the GCC mailing list posted a complaint about 
an optimization pass that assumed undefined semantics for overflow. We 
need to have a stance about this, since GDC is going into mainline GCC soon.

-- 
- Alex


More information about the Digitalmars-d mailing list