https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65712
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |MOVED Status|UNCONFIRMED |RESOLVED --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I forwarded this question to the glibc folks: https://inbox.sourceware.org/libc-alpha/CA+=Sn1mq6CmyQj-bw5=-unqfzjo+8qc2lreufusx0yrcyj-...@mail.gmail.com/T/#u Either way this is not a GCC issue since pthread_self is marked with the attribute const and GCC is doing the correct thing there. pthread_self is marked as const by glibc and not by GCC.