https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102162
--- Comment #31 from deller at gmx dot de --- Richard suggested that adding a compiler optimization barrier (__asm__ ("" : "+r" (__pptr))) might fix the problem. I tested the attached patch and it works nicely.