[PATCH, AArch64, v3 5/6] aarch64: Implement -matomic-ool

Richard Henderson richard.henderson@linaro.org
Thu Sep 5 12:17:00 GMT 2019


On 9/5/19 2:56 AM, Kyrill Tkachov wrote:
> On 11/1/18 9:46 PM, Richard Henderson wrote:
>> +  else if (TARGET_ATOMIC_OOL)
>> +    {
>> +      /* Oldval must satisfy compare afterward.  */
>> +      if (!aarch64_plus_operand (oldval, mode))
>> +       oldval = force_reg (mode, oldval);
>> +      rtx func = aarch64_atomic_ool_func (mode, mod_s, &aarch64_ool_cas_names);
>> +      rval = emit_library_call_value (func, NULL_RTX, LCT_NORMAL, r_mode,
>> +                                     oldval, mode, newval, mode,
>> +                                     XEXP (mem, 0), ptr_mode);
> 
> 
> As reported at https://gcc.gnu.org/ml/gcc-patches/2019-09/msg00118.html
> 
> I've encountered ICEs here with -mabi=ilp32 due to the mode of the address of MEM.
> 
>    rtx addr = XEXP (mem, 0);
>       if (Pmode != ptr_mode)
>     addr = convert_memory_address (ptr_mode, addr);
> 
> above the emit_library_call_value to force the address into ptr_mode and use
> addr as the argument fixed that for me.

The address should be promoted to Pmode for the call, as the little assembly
routine doesn't (and shouldn't) care for the extension itself.

I'll try aarch64-elf before re-posting.


r~



More information about the Gcc-patches mailing list