http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47106
--- Comment #2 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-12-30 20:15:22 UTC --- Created attachment 22870 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22870 Patch that fixes the bug, regstrapping When estimating the stack size of a function, we shouldn't set TREE_USED in the loop over local decls, for this makes us count every block var that is local when accounting block vars: since we preserve more block vars for debugging purposes, we end up counting them all in the latter pass, even if they weren't marked as TREE_USED before the loop over locals. Simply removing the set would be enough to fix the bug, but I figured we'd get more accurate results if we refrained from counting variables twice, so I added a bitmap. This fixes the bug, testing a bootstrap with these flags now.