http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38474
--- Comment #63 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-26 14:58:31 UTC --- (In reply to comment #61) > (In reply to comment #57) > > > > I will, on Monday. > > And by Monday I obviously meant yesterday ;-) > > Anyway, on the machine where are debugged this, compilation at -O3 > took over 16 seconds which dropped to about 13.5 seconds when I also > added -fno-devirtualize (-ftime-report showed that alias stmt walking > dropped from 82% to 75%). This is mainly due to calls to > detect_type_change from compute_known_type_jump_func, there are 36454 > of them and all are of course completely pointless because we do not > devirtualize in Fortran. > > Looking into the code, it is apparent that I even attempted to avoid > such situations but somehow was not paying enough attention. The > rather obvious patch below fixes that. With it, the compile time at > -O3 drops to 13.5 without any additional options (~50 calls to > detect_type_change_ssa and detect_type change from other places remain > but those are not a big problem here, they are not so easy to get rid > of and I hope to eventually remove the type detection machinery from > IPA altogether so I'll keep those for later). > > I'll bootstrap and test the patch and post it to the mailing list > soon. > > Index: gcc/ipa-prop.c > =================================================================== > --- gcc/ipa-prop.c (revision 188931) > +++ gcc/ipa-prop.c (working copy) > @@ -912,8 +912,8 @@ compute_known_type_jump_func (tree op, s > || is_global_var (base)) > return; > > - if (detect_type_change (op, base, call, jfunc, offset) > - || !TYPE_BINFO (TREE_TYPE (base))) > + if (!TYPE_BINFO (TREE_TYPE (base)) > + || detect_type_change (op, base, call, jfunc, offset)) > return; That change qualifies for a backport to all branches it applies to ...