[gomp] Tiny fix for #pragma omp atomic
Richard Henderson
rth@redhat.com
Thu Sep 22 15:40:00 GMT 2005
On Thu, Sep 22, 2005 at 11:33:07AM -0400, Jakub Jelinek wrote:
> c_finish_omp_atomic has a bunch of bugs ...
Yes, I have a large patch that went testing last night.
> also adds start for supporting float/complex types that are
> also allowed by OpenMP.
Float, yes. Why do you believe that complex is allowed?
It's not a scalar...
I'm also not handling pointer types properly.
> 1) it doesn't handle computation in promoted types, say
> unsigned short c; #pragma omp atomic c += 4; - will work on this next
Fixed.
> 2) probably it should also handle atomic stores, as e.g. fold will
> turn _Bool b; b |= 1; into b = 1; and I guess say with a &= 0; etc.
> will do the same
Eh, perhaps.
> 3) there seems to be a problem with the create_tmp_var_raw calls,
...
> assertion - the create_tmp_var_raw temporary has none of those set
Fixed.
> 4) float/double/_Complex float atomics - once 3) is resolved,
> this should be just a matter of making the pointer a union,
> always using compare and swap and using VIEW_CONVERT_EXPRs or something
For float/double, yes this can work. For long double I expect
to have to use an external mutex.
> 5) we should verify that rhs doesn't reference x
Yeah...
> Is the following ok for gomp for now?
No, it conflicts pretty heavily with my fixes.
r~
More information about the Gcc-patches
mailing list