On Fri, Sep 16, 2016 at 12:10:51PM +0200, Bernd Schmidt wrote:
> On 09/16/2016 12:10 PM, Trevor Saunders wrote:
> > ok, going through all the casts added here I see the following reasons
> > for them.
> > - in md files operands is a array of rtx, we should probably have a
> > different way to pass insns to the C code here. That seems worth
> > investigating incrementally.
> > - JUMP_LABEL can be a return which is not an insn. That also seems
> > like something that should be improved at some point.
> These just show that fundamentally, rtl is just dynamically typed, and used
> as such, which is why I was never massively enthusiastic about the rtx ->
> rtx_insn conversion to begin with.
I would agree that rtl is dynamically typed at the moment, and viewing
rtx_insn as an attempt to change that is certainly reasonable. I don't
know that any of these things mean rtl has to be dynamically typed. I
think that effort has already helped some things, I wouldn't want to
think about trying to get rid of rtx_insn_list without it. Further I
expect it will make it possible to change the data structures here more,
and I suspect there is room for cleverness there that isn't possible
with dynamic typing. Changing away from dynamic typing ccertainly isn't
easy, but I think there's a good amount of evidence it isn't well suited
to large complicated projects.
Alternatively if you take the view that dynamic typing is just a special
case of static typing with one type then adding more types allows you to
reduce the number of places you need to check the "type" of an object.
If we can enable some of what rtl checking gets us with out the compile
time penalty that certainly seems valuable.