------- Comment #1 from rguenth at gcc dot gnu dot org 2008-01-11 15:57 ------- It's doing the correct thing. We have
p_1, name memory tag: NMT.14, is dereferenced, points-to vars: { SFT.3 SFT.7 } (SFT.3 is x.x, SFT.7 is z.x) Now, NMT.14 is marked call clobbered: NMT.14, UID D.1582, struct A, is addressable, score: 40, direct reads: 2, direct writes: 1, indirect reads: 0, indirect writes: 2, call clobbered (passed to call), may aliases: { SFT.3 SFT.7 } because one of its pointed-to vars is call clobbered (SFT.7, aka z, which is passed to the call). Here: static void compute_tag_properties (void) { ... EXECUTE_IF_SET_IN_BITMAP (ma, 0, i, bi) { entry = referenced_var (i); /* Call clobbered entries cause the tag to be marked call clobbered. */ if (!tagcc && is_call_clobbered (entry)) { mark_call_clobbered (tag, var_ann (entry)->escape_mask); tagcc = true; changed = true; } I don't know if we can disable this if var_ann (entry)->escape_mask == ESCAPE_TO_CALL. I don't know if we need to propagate tags from NMT aliases to the NMT this way at all - after all we add all subvars of an escaped var to call clobbered vars already. So, confirmed - there's a missing optimization. -- rguenth at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu dot | |org Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords| |alias, missed-optimization Last reconfirmed|0000-00-00 00:00:00 |2008-01-11 15:57:57 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34743