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: [Patch, ppc/darwin 1/2] Fix bootstrap.


> On 3 Dec 2018, at 06:18, Alan Modra <amodra@gmail.com> wrote:
> 
> On Mon, Dec 03, 2018 at 01:26:48AM +0000, Iain Sandoe wrote:

>> The first patch makes Darwin share the sysv lowering, up until late in the process when we still use the macho_call_template.  This means we need to preserve the CALL_LONG flag for Darwin.
>> 
>> In order to match this for Darwin64, the sysv patterns needed the clobber mode to follow that of the pattern.  It seems that this might be a typo - since it’s not obvious how it would work for powerpc64 sysv as things stand (AIX and ELFv2 already follow the mode).
> 
> Hmm, yes, and I think there may be some more modes to fix.
> call_local64, call_value_local64, call_nonlocal_sysv splitter,
> call_value_nonlocal_sysv splitter, call_value_nonlocal_sysv_secure.

I’m slightly twitchy about patches I can’t fully test ..

… but
> 
>> ;; Call and call_value insns
>> +;; For the purposes of expanding calls, Darwin is very similar to SYSV.
>> (define_expand "call"
>>   [(parallel [(call (mem:SI (match_operand 0 "address_operand"))
>> 		    (match_operand 1 ""))
>> @@ -10288,7 +10289,7 @@
>>       DONE;
>>     }
>> 
>> -  if (DEFAULT_ABI == ABI_V4)
>> +  if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN)
> 
> Better yet, replace this line with "else" and tidy a little.  There's
> some dead code and the "DONE" can move out of the conditional blocks.
> 
>>     {
>>       rs6000_call_sysv (NULL_RTX, operands[0], operands[1], operands[2]);
>>       DONE;
> 
> 
>> @@ -10321,7 +10322,7 @@
>>       DONE;
>>     }
>> 
>> -  if (DEFAULT_ABI == ABI_V4)
>> +  if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN)
> 
> Similarly here,
> 
>> @@ -10765,7 +10766,7 @@
>>       DONE;
>>     }
>> 
>> -  if (DEFAULT_ABI == ABI_V4)
>> +  if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN)
> 
> and here,
> 
>>     {
>>       rs6000_sibcall_sysv (NULL_RTX, operands[0], operands[1], operands[2]);
>>       DONE;
>> @@ -10796,7 +10797,7 @@
>>       DONE;
>>     }
>> 
>> -  if (DEFAULT_ABI == ABI_V4)
>> +  if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN)
> 
> and here.
> 
>>     {
>>       rs6000_sibcall_sysv (operands[0], operands[1], operands[2], operands[3]);
>>       DONE;
>> -- 
>> 2.17.1

those are nice tidyups - done. as attached..

bootstrapped w/out issues on gcc110 (Darwin will take a longer to regstrap)..

Iain

>> 
> 
> -- 
> Alan Modra
> Australia Development Lab, IBM

Attachment: darwin-ppc-calls-1-of-2-v2.txt
Description: Text document


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