http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49000
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-05-17 09:40:20 UTC --- (In reply to comment #4) > TREE_ADDRESSABLE is cleared by maybe_optimize_var during > execute_update_addresses_taken. If the debug stmt contains just the VAR_DECL, > it will be renamed, but in this case it is MEM_REF and for some reason isn't > renamed in that case (if I manually change it to the VAR_DECL, it is). > Later on fold_stmt_1 on the debug stmt performs maybe_fold_reference and > optimizes the MEM_REF into the VAR_DECL and triggers the checking failure. > If maybe_fold_reference is used already when the DEBUG stmt is created, it > will > be just a VAR_DECL and thus it will work, but not sure if that is the way we > want to go. Hm, I thought we fold all debug stmts initially. Probably update-address-taken should handle debug-stmts in the if (update_vops) path similar to how it handles other mem-refs. But I suppose it would have to drop debug stmts in case it cannot rewrite them(?)