https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69404
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So this might be following C++ rules here dealing with qualifiers. There is no discarding of qualifiers either but rather adding them according to C++ rules. Note C and C++ deals with inner qualifiers differently. The reason why I said it does not discard here is because take: __atomic_load (&p, &q, 0); This is basically p = q; so you need to add const qualifier to the inner most type. And __atomic_load supports pointers to pointers that have qualifiers on the inner type.