Michael Matz wrote:
The easiest solution would be to just make a note that you need the PIC register and then, when expanding the prologue emit the necessary instructions. IMO that makes sense as PIC register setup usually is something the prologue does, like all the other register setups necessary.
Richard Earnshaw:
That won't work because the PIC register on ARM is a pseudo, so generating it during prologue generation is too late. It needs to exist before data flow analysis starts on the RTL.
How about emitting a set at each place the PIC register is needed, and making sure that gcse will will common these sets where appropriate?