------- Comment #4 from steven at gcc dot gnu dot org 2008-12-01 22:12 ------- davidxl, my latest patch to bug 23286 (tree-hoist_v3.diff) makes PRE in tree-ssa-pre.c code-size aware. I have tested this with CSiBE on mips-unknown-elf.
Without the patch, code size at -Os with PRE enabled is ~17% larger than -Os without PRE. With the patch, the code size increase with -Os and PRE enabled is 0.2%. With the patch and with tree hoisting enabled at -Os, code size is reduced by just a little less than 1%. With the patch and with tree hoisting enabled at -Os but RTL code hoisting disabled (i.e. the pass in gcse.c), code size is reduced by just a little less than 0.6%. (The RTL pass will be necessary mostly to hoist copies from out-of-ssa, and frame/stack pointer adjustments.) davidxl, if you have some time or someone else with time to play with this further, that'd be much appreciated. I've done my part, but having done the trick, the fun is gone and I have no intention to persue code-size aware PRE further ;-) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38204