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]

Re: Detecting casesi insns



law@cygnus.com said:
> FWIW, rth and I have have kicked around the idea of revamping this
> stuff; the number of places we have to special case code because
> ADDR_VECs are not attached to the casesi/tablejump is huge.  And most
> places get it wrong in one way or another. 

I noticed comments that alluded to this while trying to track down the 
split_edge bug I fixed yesterday.

Another thing that sprung to mind was that JUMP_LABEL is dangerous as it 
stands if a target has any insns that can contain more than one code 
label.  In these circumstances there are many occasions where you have to 
rescan the whole insn to ensure that you have fixed all the labels within 
it (this is precisely the problem with the casesi insn, which contains two 
labels, the label preceeding the ADDR_VEC and the label for the default 
branch).

I wonder if it would make sense for JUMP_LABEL to be made into a vector?  
It could then contain a list of all the labels mentioned in an insn.  For 
some optimizations it might make sense only to try with the first element 
of the vector, but when fixing other things up it would save having to 
rescan the insn; in particular, it would be a good reminder to programmers 
that there isn't guaranteed to be exactly one label to fix.


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