On Sun, Nov 06, 2011 at 06:14:18PM +0100, Eric Botcazou wrote: > > As has been suggested by Alexandre in the PR, this patch allows merging > > basic blocks which couldn't be merged before because of user (non-forced) > > labels at the beginning of the second basic blocks. > > With this patch the user label is thrown away (for -g0 or -g > > -fno-var-tracking-assignments) or turned into a debug bind stmt which > > contains the label. > > Do we really want to do that if !optimize?
You're right, at -O0 we don't do VTA and thus the user labels would be dropped on the floor. Fixed thusly, committed to trunk as obvious: 2011-11-06 Jakub Jelinek <ja...@redhat.com> * tree-cfg.c (gimple_can_merge_blocks_p): For -O0 don't remove any user labels. --- gcc/tree-cfg.c.jj 2011-11-04 18:01:25.000000000 +0100 +++ gcc/tree-cfg.c 2011-11-06 20:37:09.000000000 +0100 @@ -1454,8 +1454,8 @@ gimple_can_merge_blocks_p (basic_block a break; lab = gimple_label_label (stmt); - /* Do not remove user forced labels. */ - if (!DECL_ARTIFICIAL (lab) && FORCED_LABEL (lab)) + /* Do not remove user forced labels or for -O0 any user labels. */ + if (!DECL_ARTIFICIAL (lab) && (!optimize || FORCED_LABEL (lab))) return false; } Jakub