This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] integer overflow checking builtins in constant expressions
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Martin Sebor <msebor at gmail dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Tue, 31 May 2016 23:44:45 +0200
- Subject: Re: [PATCH] integer overflow checking builtins in constant expressions
- Authentication-results: sourceware.org; auth=none
- References: <57263154 dot 5080401 at gmail dot com> <927ff104-49e3-57a5-eed5-2ca1b4fdf0a8 at redhat dot com> <574DF88B dot 1090508 at gmail dot com> <3913c9df-9790-793e-4ed4-10bdb72ebd6d at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, May 31, 2016 at 05:31:48PM -0400, Jason Merrill wrote:
> >I'm not quite sure where to move this hunk so that it could be
> >shared or with what.
> >
> >With the patch, fold_builtin_arith_overflow returns the overflow
> >bit alone when the last argument is null. Otherwise it returns
> >a complex number with both the overflow bit and the result. Here
> >we need both parts of the result. I suppose I could factor out
> >the call to size_binop_loc into its own function, have it return
> >the overflow bit, and set a by-reference argument to the arithmetic
> >result so that it could be built into a complex result here but
> >that doesn't seem like it would gain us much, if anything.
>
> Yeah, I'm not sure what I was thinking. The patch is OK.
Sorry for not paying attention, but I think it is wrong to change the clang
compatibility builtins at all. They are provided for clang compatibility,
nothing else, therefore we shouldn't change anything on them.
It is reasonable to extend the GNU builtins.
Jakub