This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: reload displacement optimization


> While looking into some problems in reload this evening (which I could
> not reproduce, annoyingly), I noticed that reload would produce, when
> a displacement off of a base register is out of range,
> 
>         lda $6,-31856
>         ldah $6,1($6)
>         addq $6,$30,$6
>         ldq $12,0($6)
> 
> when
> 
> 	ldah $6,1($30)
> 	ldq $12,-31856($6)
> 
> is sufficient.
> 
> The solution, I believe, is to teach find_reloads_address about
> this new way to break up an address.  The following patch does this,
> but in a blatently machine dependent way.
> 
> Can anyone think of a way to properly conditionalize this, and
> to break up the address?
> 
> 

Can't we have a RELOAD_LEGITIMIZE_ADDRESS() in the same way that we have LEGITIMIZE_ADDRESS().  This could then be a tuning option which will be used if it produces valid insns, but thrown out otherwise.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]