Re: [PATCH] Add __int128 test to ubsan

2013-12-17 Thread Marek Polacek
On Tue, Dec 17, 2013 at 06:50:24PM +0100, Jakub Jelinek wrote: > Isn't this undefined behavior in C? I mean, shouldn't you > shift up (unsigned __int128) 1 and only cast to (__int128) at the end? Oh my, how could I. Yeah, (__int128) 1 << 127 is UB. Fixed below, ok now? 2013-12-17 Marek Polace

Re: [PATCH] Add __int128 test to ubsan

2013-12-17 Thread Jakub Jelinek
On Tue, Dec 17, 2013 at 07:16:18PM +0100, Marek Polacek wrote: > On Tue, Dec 17, 2013 at 06:50:24PM +0100, Jakub Jelinek wrote: > > Isn't this undefined behavior in C? I mean, shouldn't you > > shift up (unsigned __int128) 1 and only cast to (__int128) at the end? > > Oh my, how could I. > > Yea

Re: [PATCH] Add __int128 test to ubsan

2013-12-17 Thread Jakub Jelinek
On Tue, Dec 17, 2013 at 06:17:01PM +0100, Marek Polacek wrote: > Regtested on x86_64-linux with -m32/-m64. > > Ok? > > 2013-12-17 Marek Polacek > > testsuite/ > * c-c++-common/ubsan/overflow-int128.c: New test. > > --- gcc/testsuite/c-c++-common/ubsan/overflow-int128.c.mp 2013-12-1

[PATCH] Add __int128 test to ubsan

2013-12-17 Thread Marek Polacek
Regtested on x86_64-linux with -m32/-m64. Ok? 2013-12-17 Marek Polacek testsuite/ * c-c++-common/ubsan/overflow-int128.c: New test. --- gcc/testsuite/c-c++-common/ubsan/overflow-int128.c.mp 2013-12-17 16:54:28.123468111 +0100 +++ gcc/testsuite/c-c++-common/ubsan/overflow-int12