So it seems like we agreed that this is a problem that should be fixed.
Shall I create a bug report suggesting for it?
Am Friday, 12. August 2011, 09:32:11 schrieb Richard Guenther:
> On Thu, Aug 11, 2011 at 10:36 PM, Joe Buck wrote:
> > On Thu, Aug 11, 2011 at 1:58 PM, Joseph S. Myers
> >
> >
On Thu, Aug 11, 2011 at 10:36 PM, Joe Buck wrote:
> On Thu, Aug 11, 2011 at 1:58 PM, Joseph S. Myers
> wrote:
>> -ftrapv and -fwrapv should have no effect on pointer subtraction.
>
> Gaby writes:
>
>> Yes!
>
> Wouldn't it suffice to convert the pointers to unsigned, do an unsigned
> subtraction
On Thu, Aug 11, 2011 at 1:58 PM, Joseph S. Myers
wrote:
> -ftrapv and -fwrapv should have no effect on pointer subtraction.
Gaby writes:
> Yes!
Wouldn't it suffice to convert the pointers to unsigned, do an unsigned
subtraction, and then convert the result to signed? This would then guarantee
On Thu, Aug 11, 2011 at 1:58 PM, Joseph S. Myers
wrote:
> -ftrapv and -fwrapv should have no effect on pointer subtraction.
Yes!
-- Gaby
On Thu, Aug 11, 2011 at 12:15 PM, Richard Guenther
wrote:
> On Thu, Aug 11, 2011 at 7:13 PM, Joe Buck wrote:
>> On Thu, Aug 11, 2011 at 09:05:19AM -0700, Florian Merz wrote:
>>> If I remember the standard correctly, pointer subtraction is valid if both
>>> pointers point to elements of the same a
On Thu, 11 Aug 2011, Richard Guenther wrote:
> int x,y;
> int main ()
> {
> char *a, *b;
> __INTPTR_TYPE__ w;
> if (x)
> a = 0x7ffe;
> else
> a = 0x7fff;
> if (y)
> b = 0x8001;
> else
> b = 0x8000;
> w = b - a;
> return w;
> }
>
> indeed traps with
Am Thursday, 11. August 2011, 19:15:41 schrieb Richard Guenther:
> On Thu, Aug 11, 2011 at 7:13 PM, Joe Buck wrote:
> > On Thu, Aug 11, 2011 at 09:05:19AM -0700, Florian Merz wrote:
> >> If I remember the standard correctly, pointer subtraction is valid if
> >> both pointers point to elements of t
On Thu, Aug 11, 2011 at 7:13 PM, Joe Buck wrote:
> On Thu, Aug 11, 2011 at 09:05:19AM -0700, Florian Merz wrote:
>> If I remember the standard correctly, pointer subtraction is valid if both
>> pointers point to elements of the same array or to one past the last element
>> of the array. According
On Thu, Aug 11, 2011 at 09:05:19AM -0700, Florian Merz wrote:
> If I remember the standard correctly, pointer subtraction is valid if both
> pointers point to elements of the same array or to one past the last element
> of the array. According to this 0x8000 - 0x7FFF should be a valid
>
.
>>
>> > Thanks a lot and regards,
>> > Florian
>> >
>> > P.S: It seems like clang does not treat this subtraction as signed.
>> >
>> > [1] http://baldur.iti.kit.edu/llbmc/
>> >
>> > -- Weitergeleitete Nachricht -
urely must overflow, and
the result therefore would be undefined.
> Richard.
>
> > Thanks a lot and regards,
> > Florian
> >
> > P.S: It seems like clang does not treat this subtraction as signed.
> >
> > [1] http://baldur.iti.kit.edu/llbmc/
> >
s a lot and regards,
> Florian
>
> P.S: It seems like clang does not treat this subtraction as signed.
>
> [1] http://baldur.iti.kit.edu/llbmc/
>
> ------ Weitergeleitete Nachricht ------
>
> Betreff: Re: [LLVMdev] Handling of pointer difference in llvm-gcc an
signed subtraction?
Thanks a lot and regards,
Florian
P.S: It seems like clang does not treat this subtraction as signed.
[1] http://baldur.iti.kit.edu/llbmc/
-- Weitergeleitete Nachricht --
Betreff: Re: [LLVMdev] Handling of pointer difference in llvm-gcc and clang
Datum
13 matches
Mail list logo