http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39326
--- Comment #54 from Richard Biener <rguenth at gcc dot gnu.org> --- For the original testcase on trunk we get at -O1 tree loop invariant motion: 37.20 (16%) usr 0.02 ( 1%) sys 37.20 (16%) wall 12127 kB ( 1%) ggc dead store elim1 : 17.42 ( 7%) usr 0.04 ( 2%) sys 17.44 ( 7%) wall 28345 kB ( 3%) ggc dead store elim2 : 26.22 (11%) usr 0.00 ( 0%) sys 26.20 (11%) wall 18664 kB ( 2%) ggc combiner : 15.36 ( 6%) usr 0.04 ( 2%) sys 15.39 ( 6%) wall 70073 kB ( 7%) ggc LRA hard reg assignment : 74.07 (31%) usr 0.02 ( 1%) sys 74.05 (31%) wall 0 kB ( 0%) ggc reload CSE regs : 12.67 ( 5%) usr 0.00 ( 0%) sys 12.66 ( 5%) wall 13315 kB ( 1%) ggc TOTAL : 237.86 1.83 239.60 999181 kB so that's still slow (memory usage is peaking at about 1.5GB now, during RA). tree LIM: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls s/call s/call name 4.22 120.72 9.83 299080 0.00 0.00 ref_indep_loop_p_2(loop*, mem_ref*, bool) 1.89 151.82 4.41 1712943886 0.00 0.00 mem_refs_may_alias_p(mem _ref*, mem_ref*, pointer_map_t**) [clone .constprop.60] 0.21 197.02 0.48 12192 0.00 0.00 force_move_till(tree_node*, tree_node**, void*) at -O2 this will blow up completely as it then runs into the affine-based disambiguation.