This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [m68k] -pcrel fix for TARGET_COLDFIRE


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/


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