Re: [PATCH] Reject boolean/enum types in last arg of __builtin_*_overflow_p (take 2)

2016-06-23 Thread Jason Merrill
I thought I already approved that patch. If not, consider this approval. Jason On Wed, Jun 22, 2016 at 12:34 AM, Jeff Law wrote: > On 06/15/2016 05:47 AM, Jakub Jelinek wrote: >> >> On Tue, Jun 14, 2016 at 11:13:28AM -0600, Martin Sebor wrote: Here is an untested

Re: [PATCH] Reject boolean/enum types in last arg of __builtin_*_overflow_p (take 2)

2016-06-21 Thread Jeff Law
On 06/15/2016 05:47 AM, Jakub Jelinek wrote: On Tue, Jun 14, 2016 at 11:13:28AM -0600, Martin Sebor wrote: Here is an untested patch for that. Except that the middle-end considers conversions between BOOLEAN_TYPE and single bit unsigned type as useless, so in theory this can't work well, and

Re: [PATCH] Reject boolean/enum types in last arg of __builtin_*_overflow_p (take 2)

2016-06-15 Thread Jakub Jelinek
On Wed, Jun 15, 2016 at 08:08:22AM -0600, Martin Sebor wrote: > I like the idea of being able to use the built-ins for this, but > I think it would be confusing for them to follow subtly different > rules for C than for C++. Since the value of the last argument I think it isn't that hard to

Re: [PATCH] Reject boolean/enum types in last arg of __builtin_*_overflow_p (take 2)

2016-06-15 Thread Martin Sebor
On 06/15/2016 06:16 AM, Joseph Myers wrote: On Wed, 15 Jun 2016, Jakub Jelinek wrote: The only thing I'm unsure about is what to do with bitfield types. For __builtin_{add,sub,mul}_overflow it is not an issue, as one can't take address of a bitfield. For __builtin_{add,sub,mul}_overflow_p

Re: [PATCH] Reject boolean/enum types in last arg of __builtin_*_overflow_p (take 2)

2016-06-15 Thread Joseph Myers
On Wed, 15 Jun 2016, Jakub Jelinek wrote: > The only thing I'm unsure about is what to do with bitfield types. > For __builtin_{add,sub,mul}_overflow it is not an issue, as one can't take > address of a bitfield. For __builtin_{add,sub,mul}_overflow_p right now, > the C FE doesn't promote the

[PATCH] Reject boolean/enum types in last arg of __builtin_*_overflow_p (take 2)

2016-06-15 Thread Jakub Jelinek
On Tue, Jun 14, 2016 at 11:13:28AM -0600, Martin Sebor wrote: > >Here is an untested patch for that. Except that the middle-end considers > >conversions between BOOLEAN_TYPE and single bit unsigned type as useless, > >so in theory this can't work well, and in practice only if we are lucky >