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

Chris Lattner clattner at apple.com
Mon Feb 2 13:31:31 PST 2009


On Feb 2, 2009, at 1:30 PM, Eli Friedman wrote:

> 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.

GEP is currently always undefined, add is currently always defined.   
Both should get the same set of flags IMO.

-Chris



More information about the llvm-commits mailing list