This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Remove dead labels to increase superblock scope


On 25/11/11 14:05, Steven Bosscher wrote:
> On Fri, Nov 25, 2011 at 2:03 PM, Michael Matz <matz@suse.de> wrote:
>> Hi,
>>
>> On Fri, 25 Nov 2011, Tom de Vries wrote:
>>
>>>> Note that you actually can remove labels also if they are
>>>> !can_delete_label_p, if you use delete_insn (which you do).  It will
>>>> replace such undeletable labels by a DELETED_LABEL note.
>>>
>>> I tried that as well but ran into these errors in rtl_verify_flow_info_1:
>>> ...
>>> libquadmath/printf/cmp.c:56:1: error: NOTE_INSN_BASIC_BLOCK is missing for block 6
>>> libquadmath/printf/cmp.c:56:1: error: NOTE_INSN_BASIC_BLOCK 79 in middle of
>>> basic block 6
>>
>> Hmpf, probably bitrotted over time.  Oh well, so be it.
> 
> No, DELETED_LABEL notes still work just fine. It depends on how you
> remove the label and replace it with a note, and Tom isn't showing
> what he did, so...

This is the patch with which I ran into the rtl_verify_flow_info_1 errors:
...
Index: gcc/cfglayout.c
===================================================================
--- gcc/cfglayout.c (revision 181172)
+++ gcc/cfglayout.c (working copy)
@@ -857,6 +857,9 @@ fixup_reorder_chain (void)
 				       (e_taken->src, e_taken->dest));
 		  e_taken->flags |= EDGE_FALLTHRU;
 		  update_br_prob_note (bb);
+		  if (LABEL_NUSES (ret_label) == 0
+		      && single_pred_p (e_taken->dest))
+		    delete_insn (ret_label);
 		  continue;
 		}
 	    }
...

Thanks,
- Tom

> 
> Ciao!
> Steven


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]