------- Comment #6 from rguenth at gcc dot gnu dot org 2009-09-26 11:29 ------- Whoever designed this feature should be beaten with a cluebat for not asking people on how this will interact with aliasing.
IMHO the testcase should be declared invalid and it should be documented that an aliased or weakreffed var may be only accessed via its original declaration (x in this case). Case closed for me. Any other way not only breaks points-to analysis but also trivial alias checks throughout the compiler. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25140