make genattrtab generate smaller code

law@redhat.com law@redhat.com
Mon Sep 8 13:57:00 GMT 2003


In message <Pine.LNX.4.44.0309080706100.13736-100000@wotan.suse.de>, Michael Ma
tz writes:
 >> My only concern is that this actually changes the behavior of the
 >> program, in that it may cause attr functions to be called with insns
 >> that would previously never have that function called for them.
 >
 >Correct.  But that would mean the author of the .md file relied on
 >undocumented behaviour.  And given that get_attr_aaa() needs to return
 >sensible results when called from toplevel (i.e. either from the emitters
 >or the scheduler, or whatever) they should also return sensible results
 >when called from inside other get_attr() functions.
 >
 >In addition when and how the get_attr() are called from inside other
 >get_attr() currently totally depends on the expression optimizer in
 >genattrtab, which also depends on the actual insn patterns and
 >define_attr(), hence this was unstable anyway.  So I think the chance of
 >this change breaking some .md files should be small, although of course I
 >don't know.  It's theoretically possible in which case I think we should
 >define the .md file to be wrong.
It has always been the case that callers of get_attr_xxx have had to 
pre-filter out things like CLOBBERs, USEs and SEQUENCEs (ie, things which
are not recognizable insns).

Now, one could argue that's a lame interface and that the get_attr_xxx
functions should do something sensible with those non-recognizable
insns.  That would allow for some minor cleanups.

jeff




More information about the Gcc-patches mailing list