[llvm-commits] [PATCH] -fno-strict-overflow/-fwrapv: allow pointer arithmetic to be defined as wrapping instead of undefined on overflow

Eli Friedman eli.friedman at gmail.com
Mon Feb 2 13:30:09 PST 2009


On Mon, Feb 2, 2009 at 12:33 PM, Chris Lattner <clattner at apple.com> wrote:
>
> On Feb 1, 2009, at 12:32 PM, Török Edwin wrote:
>
>> Hi,
>>
>> gcc provides -fwrapv and -fno-strict-overflow that allows pointer +
>> unsigned to be treated as possibly wrapping, instead of undefined ->
>> can't happen (the default with -fstrict-overflow, -O2, -O3 or -Os).
>
> I think the right way to handle this is to add a "overflow
> characteristic" field to the integer operations.

We already implement -fwrapv behavior for integers... the issue at hand is GEP.

-Eli




More information about the llvm-commits mailing list