[m68k] -pcrel fix for TARGET_COLDFIRE
Daniel Jacobowitz
drow@false.org
Fri Jul 29 12:58:00 GMT 2005
On Fri, Jul 29, 2005 at 08:51:29AM +0200, Bernardo Innocenti wrote:
> Hello,
>
> this wasn't regression tested as the testsuite can't be (easily) run
> on ColdFire targets, but it looks pretty straightforward.
>
> This bug also affects 4.0 and 3.4 so I'd like to backport it
> to these branches too.
>
>
> 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.
Hi Bernardo,
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.
> 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.
--
Daniel Jacobowitz
CodeSourcery, LLC
More information about the Gcc-patches
mailing list