This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [m68k] -pcrel fix for TARGET_COLDFIRE
- From: Bernardo Innocenti <bernie at develer dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Andreas Schwab <schwab at suse dot de>,Peter Barada <peter at the-baradas dot com>, "Tarani, Andrea" <andrea dot tarani at gilbarco dot com>
- Date: Sat, 30 Jul 2005 17:31:36 +0200
- Subject: Re: [m68k] -pcrel fix for TARGET_COLDFIRE
- Openpgp: id=FC6A66CA;url=https://www.develer.com/~bernie/gpgkey.txt
- References: <42E9D1F1.8000409@develer.com> <20050729125847.GA26274@nevyn.them.org>
Daniel Jacobowitz wrote:
>>2005-07-29 Andrea Tarani <andrea.tarani@gilbarco.com>
>>
>> * config/m68k/m68k.c (m68k_output_pic_call): Avoid generating a bsr.l
>> opcode on ColdFire targets when compiling with -pcrel enabled.
>
> I posted a patch for a related issue a couple of months ago but never
> had time to revise and retest it. If you're going to change this bit
> of code, can we get both of the bsr.l's, please?
>
> I'm assuming from context of the patch that both TARGET_CFV4 and
> TARGET_68020 have bsr.l; stop me if that's wrong.
My manual says the CFv4 supports bsr.l, but Peter Barada
might know better.
>> else if (TARGET_PCREL)
>
> else if (TARGET_PCREL && (TARGET_68020 || TARGET_CFV4))
>
>
>>- out = "bsr.l %o0";
>>+ {
>>+ if (TARGET_COLDFIRE && !TARGET_CFV4)
>>+ out = "lea %o0-.-8,%%a1\n\tjsr 0(%%pc,%%a1)";
>>+ else
>>+ out = "bsr.l %o0";
>>+ }
>> else if ((flag_pic == 1) || TARGET_68020)
>
> else if (TARGET_68020 || TARGET_CFV4)
>
> Then the new lea/jsr block becomes unnecessary.
We can't factor code like this since we need to say
"%o0" with -mpcrel and "%0" with -fpic/-fPIC.
%o is an m68k-specific formatting code:
'o' for operands to go directly to output_operand_address (bypassing
print_operand_address--used only for SYMBOL_REFs under TARGET_PCREL)
--
// Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/ http://www.develer.com/