RFC: Allowing target specific extensions to RTL checking
Nick Clifton
nickc@redhat.com
Thu Jan 13 17:05:00 GMT 2011
Hi Richard,
>> So is there some way that I can say that for the RX target the
>> frame_related bit on CONST_INTs can be set ?
>
> No, there isn't. Please describe what you're trying to achieve here.
> With no further information it sounds like you want
>
> (const:SI (unspec:SI [(const_int x)] UNSPEC_SOMETHING))
Hmm, maybe that is what I need.
In essence I am trying to fix a bug with the implementation of the
-max-constant-size feature of the RX port. This feature can be used to
force large constants to be dumped into a constant pool and loaded
indirectly, rather than being encoded in each instruction as needed.
This can lead to smaller/faster code, but there is no simple heuristic
to determine when this will work, hence the command line switch.
The bug is that if -mmax-constant-size is being used and a function
needs a large stack frame the prologue generation code will emit an
ADDSI3 insn without allowing for the fact that the constant value it is
using is no longer valid. What I wanted was a way to be able to mark
constants used by function prologues and epilogues as being special and
exempt from the limits checking performed by the LEGITIMATE_CONSTANT_P
macro.
I found that I could set the RTX_FRAME_RELATED_P bit on the stack frame
adjust constants and then detect them in rx_is_legitimate_constant().
But this breaks when I build with --enable-checking. Hence my original
email to find out if there is a better way to do this.
Cheers
Nick
More information about the Gcc-patches
mailing list