Re: [PATCH] __atomic error reporting

2011-11-24 Thread Joseph S. Myers
On Thu, 24 Nov 2011, Andrew MacLeod wrote: > On 11/22/2011 04:20 PM, Joseph S. Myers wrote: > > * If TYPE_SIZE_UNIT if the pointer target type is zero. This could be the > > case for empty structures or zero-size arrays (both GNU extensions). > > Logically there's nothing wrong with atomic operat

Re: [PATCH] __atomic error reporting

2011-11-24 Thread Andrew MacLeod
On 11/22/2011 04:20 PM, Joseph S. Myers wrote: * If TYPE_SIZE_UNIT if the pointer target type is zero. This could be the case for empty structures or zero-size arrays (both GNU extensions). Logically there's nothing wrong with atomic operations on such a zero-size object (they should evaluate al

Re: [PATCH] __atomic error reporting

2011-11-22 Thread Joseph S. Myers
On Tue, 22 Nov 2011, Andrew MacLeod wrote: > int n = get_atomic_generic_size (loc, function, params); > > + /* Size of 0 is an error condition. */ > + if (n == 0) > + { > + *new_return = error_mark_node; > + return true; > + } As far as I can see, get_atomic_generi

[PATCH] __atomic error reporting

2011-11-21 Thread Andrew MacLeod
PR 51256 points out that void *p; __atomic_compare_exchange(p, p, p, 0, 0, 0); results in an ICE. This patch reports the error that a generic function call must not have a void pointer for the first argument, or a size of the object cannot be determined. It also now returns error_mark_node w