https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82946
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) As I explained in comment #0, a_5(D)->d can safely be assumed not to point to itself as a result of the subsequent access to what it points to in strlen, and thanks to the fact that a string literal is never a valid representation of a pointer. Joseph's bare metal case of strlen (((struct A*)"123")->d) from comment #2 could be handled either by detecting and warning about it, or accommodated under -ffreestanding or some new option to disable the optimization.