[Patch] Make atomics work on FreeBSD+arm

Rafael EspĂ­ndola rafael.espindola at gmail.com
Fri May 31 12:10:21 PDT 2013


>> With this the user would get an undefined reference instead of a
>> compiler error, no?
>
> Well, yes/no. The __atomic_fetch_* functions can only be applied to
> integer types. Poorly constructed example:
>
> struct henk {
>         char x[100];
> };
>
> int
> main() {
>         _Atomic(struct henk) piet;
>         struct henk jan;
>
>         __atomic_fetch_xor(&piet, jan, 5);
> }
>
> bla.c:10:2: error: first argument to bitwise atomic operation must be
> a pointer to integer ('_Atomic(struct henk) *' invalid)

OK, makes sense. This is OK with me assuming the functions being
called match the one gcc calls. Just one request, please commit the
test changes that already work first. For example


-// PPC32: load atomic i8* @c1 seq_cst
+// PPC32: = load atomic i8* @c1 seq_cst

That way it is easier for someone reading the patch to figure out what it fixed.

Cheers,
Rafael



More information about the cfe-commits mailing list