The default -mpic-register (on ARM/Thumb) is r10. In -mthumb mode, r10
is not available to the math instructions as a direct argument. On top
of that, preserving r10 complicates the function prologue. Does it
make more sense to use a directly accessible register, r7 for example,
as the default -mpic-register when in -mthumb mode? Can a
non-preserved register, such as r3, be used instead? (assuming the
compiler saves the function argument in r3 somewhere)

Why is the PIC register fixed? Could the compiler register allocation
logic be allowed to allocate the _GLOBAL_OFFSET_TABLE_ pointer the
same as any other variable? In which case it would probably realise
that
        cost(r3) < cost(r7) < cost(r10)
at least in the case where r3 isn't being used by a function argument.

Cheers,
Shaun

Reply via email to