diff mbox

[aarch64] Fix 61545

Message ID 53A1214A.5070900@redhat.com
State New
Headers show

Commit Message

Richard Henderson June 18, 2014, 5:19 a.m. UTC
Trivial fix for missing clobber of the flags over the tlsdesc call.

Ok for all branches?


r~

	* config/aarch64/aarch64.md (tlsdesc_small_<PTR>): Clobber CC_REGNUM.

Comments

Richard Earnshaw June 18, 2014, 7:57 a.m. UTC | #1
On 18/06/14 06:19, Richard Henderson wrote:
> Trivial fix for missing clobber of the flags over the tlsdesc call.
> 
> Ok for all branches?
> 
> 

OK.

R.

> r~
> 
> 	* config/aarch64/aarch64.md (tlsdesc_small_<PTR>): Clobber CC_REGNUM.
> 
> 
> z
> 
> 
> diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
> index a4d8887..1ee2cae 100644
> --- a/gcc/config/aarch64/aarch64.md
> +++ b/gcc/config/aarch64/aarch64.md
> @@ -3855,6 +3855,7 @@
>          (unspec:PTR [(match_operand 0 "aarch64_valid_symref" "S")]
>  		   UNSPEC_TLSDESC))
>     (clobber (reg:DI LR_REGNUM))
> +   (clobber (reg:CC CC_REGNUM))
>     (clobber (match_scratch:DI 1 "=r"))]
>    "TARGET_TLS_DESC"
>    "adrp\\tx0, %A0\;ldr\\t%<w>1, [x0, #%L0]\;add\\t<w>0, <w>0, %L0\;.tlsdesccall\\t%0\;blr\\t%1"
>
Kyle McMartin June 18, 2014, 10:57 p.m. UTC | #2
On Tue, Jun 17, 2014 at 10:19:06PM -0700, Richard Henderson wrote:
> Trivial fix for missing clobber of the flags over the tlsdesc call.
> 
> Ok for all branches?
> 
> 
> r~
> 
> 	* config/aarch64/aarch64.md (tlsdesc_small_<PTR>): Clobber CC_REGNUM.
> 

pretty sure we need a similar fix for tlsgd_small, since __tls_get_addr
could clobber CC as well.

regards, Kyle

> diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
> index a4d8887..1ee2cae 100644
> --- a/gcc/config/aarch64/aarch64.md
> +++ b/gcc/config/aarch64/aarch64.md
> @@ -3855,6 +3855,7 @@
>          (unspec:PTR [(match_operand 0 "aarch64_valid_symref" "S")]
>  		   UNSPEC_TLSDESC))
>     (clobber (reg:DI LR_REGNUM))
> +   (clobber (reg:CC CC_REGNUM))
>     (clobber (match_scratch:DI 1 "=r"))]
>    "TARGET_TLS_DESC"
>    "adrp\\tx0, %A0\;ldr\\t%<w>1, [x0, #%L0]\;add\\t<w>0, <w>0, %L0\;.tlsdesccall\\t%0\;blr\\t%1"
Richard Henderson June 18, 2014, 11:04 p.m. UTC | #3
On 06/18/2014 03:57 PM, Kyle McMartin wrote:
> pretty sure we need a similar fix for tlsgd_small, since __tls_get_addr
> could clobber CC as well.

As I replied in IRC, no, because tlsgd_small is modeled with an actual
CALL_INSN, and thus call-clobbered registers work as normal.


r~
Kyle McMartin June 18, 2014, 11:38 p.m. UTC | #4
On Wed, Jun 18, 2014 at 04:04:53PM -0700, Richard Henderson wrote:
> On 06/18/2014 03:57 PM, Kyle McMartin wrote:
> > pretty sure we need a similar fix for tlsgd_small, since __tls_get_addr
> > could clobber CC as well.
> 
> As I replied in IRC, no, because tlsgd_small is modeled with an actual
> CALL_INSN, and thus call-clobbered registers work as normal.
> 

Ah, sorry I missed your reply. Makes sense.

regards, Kyle
diff mbox

Patch

diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md
index a4d8887..1ee2cae 100644
--- a/gcc/config/aarch64/aarch64.md
+++ b/gcc/config/aarch64/aarch64.md
@@ -3855,6 +3855,7 @@ 
         (unspec:PTR [(match_operand 0 "aarch64_valid_symref" "S")]
 		   UNSPEC_TLSDESC))
    (clobber (reg:DI LR_REGNUM))
+   (clobber (reg:CC CC_REGNUM))
    (clobber (match_scratch:DI 1 "=r"))]
   "TARGET_TLS_DESC"
   "adrp\\tx0, %A0\;ldr\\t%<w>1, [x0, #%L0]\;add\\t<w>0, <w>0, %L0\;.tlsdesccall\\t%0\;blr\\t%1"