[AArch64] Add early clobber for the store_exclusive patterns.

Message ID 1158ef7e-58c9-a33e-75a4-65a410499493@arm.com
State New
Headers show
Series
  • [AArch64] Add early clobber for the store_exclusive patterns.
Related show

Commit Message

Ramana Radhakrishnan July 12, 2018, 2:22 p.m.
Hi,


I've had this in my patch stack after discovering the gas issue where we
weren't warning on cases that were unpredictable according to the
architecture.

I would like to backport this fix to earlier GCC branches too. I did a
few attempts but I haven't been able to trigger the unpredictable behaviour.

Bootstrapped and regression tested on AArch64 , no regressions.

Ok ?

Thanks,
Ramana


* config/aarch64/atomics.md (aarch64_store_exclusive<mode>): Add early
clobber.
commit 0608cb64b97368dc1bbea87e3a9541cfb832c015
Author: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Date:   Tue Jun 12 16:03:24 2018 +0100

    [Patch AArch64] Add early clobber for aarch64_store_exclusive.

Comments

Richard Earnshaw (lists) July 12, 2018, 3:40 p.m. | #1
On 12/07/18 15:22, Ramana Radhakrishnan wrote:
> Hi,

> 

> 

> I've had this in my patch stack after discovering the gas issue where we

> weren't warning on cases that were unpredictable according to the

> architecture.

> 

> I would like to backport this fix to earlier GCC branches too. I did a

> few attempts but I haven't been able to trigger the unpredictable behaviour.

> 

> Bootstrapped and regression tested on AArch64 , no regressions.

> 

> Ok ?

> 

> Thanks,

> Ramana

> 


OK for trunk and all live branches.

R.

> 

> * config/aarch64/atomics.md (aarch64_store_exclusive<mode>): Add early

> clobber.

> 

> 

> earlyclobber.txt

> 

> 

> commit 0608cb64b97368dc1bbea87e3a9541cfb832c015

> Author: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>

> Date:   Tue Jun 12 16:03:24 2018 +0100

> 

>     [Patch AArch64] Add early clobber for aarch64_store_exclusive.

> 

> diff --git a/gcc/config/aarch64/atomics.md b/gcc/config/aarch64/atomics.md

> index 68dc65c..cd8c44e 100644

> --- a/gcc/config/aarch64/atomics.md

> +++ b/gcc/config/aarch64/atomics.md

> @@ -530,7 +530,7 @@

>  )

>  

>  (define_insn "aarch64_store_exclusive<mode>"

> -  [(set (match_operand:SI 0 "register_operand" "=r")

> +  [(set (match_operand:SI 0 "register_operand" "=&r")

>      (unspec_volatile:SI [(const_int 0)] UNSPECV_SX))

>     (set (match_operand:ALLI 1 "aarch64_sync_memory_operand" "=Q")

>      (unspec_volatile:ALLI

>

Patch

diff --git a/gcc/config/aarch64/atomics.md b/gcc/config/aarch64/atomics.md
index 68dc65c..cd8c44e 100644
--- a/gcc/config/aarch64/atomics.md
+++ b/gcc/config/aarch64/atomics.md
@@ -530,7 +530,7 @@ 
 )
 
 (define_insn "aarch64_store_exclusive<mode>"
-  [(set (match_operand:SI 0 "register_operand" "=r")
+  [(set (match_operand:SI 0 "register_operand" "=&r")
     (unspec_volatile:SI [(const_int 0)] UNSPECV_SX))
    (set (match_operand:ALLI 1 "aarch64_sync_memory_operand" "=Q")
     (unspec_volatile:ALLI