This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add __int128 test to ubsan
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 17 Dec 2013 19:17:22 +0100
- Subject: Re: [PATCH] Add __int128 test to ubsan
- Authentication-results: sourceware.org; auth=none
- References: <20131217171701 dot GW11710 at redhat dot com> <20131217175024 dot GK892 at tucnak dot redhat dot com> <20131217181618 dot GX11710 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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.
>
> Yeah, (__int128) 1 << 127 is UB. Fixed below, ok now?
Ok.
> 2013-12-17 Marek Polacek <polacek@redhat.com>
>
> testsuite/:
> * c-c++-common/ubsan/overflow-int128.c: New test.
Jakub