https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84900
--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> --- Yes, I'd consider this invalid code. Presumably there's some issue with the GNU extension allowing casts of structs to the same type, whereby in some cases it fails to make the result of the cast not an lvalue.