Patchwork [SPARC] Fix PR target/54121

login
register
mail settings
Submitter Eric Botcazou
Date Dec. 11, 2012, 6:37 p.m.
Message ID <4617091.BFNxLO7VlM@polaris>
Download mbox | patch
Permalink /patch/205292/
State New
Headers show

Comments

Eric Botcazou - Dec. 11, 2012, 6:37 p.m.
This is a regression present on mainline and 4.7 branch for the SPARC.  Reload 
is trying to change the value of a symbol(!) because it is mightily confused 
by an output constraint on a source operand (old pasto in some TLS patterns).

Fixed thusly, tested on SPARC64/Linux, applied on all branches.


2012-12-11  Eric Botcazou  <ebotcazou@adacore.com>

	PR target/54121
	* config/sparc/sparc.md (tldo_stb_sp32): Fix pasto.
	(tldo_stb_sp64): Likewise.
	(tldo_sth_sp32): Likewise.
	(tldo_sth_sp64): Likewise.
	(tldo_stw_sp32): Likewise.
	(tldo_stw_sp64): Likewise.
	(tldo_stx_sp64): Likewise.


2012-12-11  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc.dg/pr54121.c: New test.
David Miller - Dec. 11, 2012, 6:56 p.m.
From: Eric Botcazou <ebotcazou@adacore.com>
Date: Tue, 11 Dec 2012 19:37:36 +0100

> This is a regression present on mainline and 4.7 branch for the SPARC.  Reload 
> is trying to change the value of a symbol(!) because it is mightily confused 
> by an output constraint on a source operand (old pasto in some TLS patterns).
> 
> Fixed thusly, tested on SPARC64/Linux, applied on all branches.

Thanks for fixing this Eric.

Patch

Index: config/sparc/sparc.md
===================================================================
--- config/sparc/sparc.md	(revision 194382)
+++ config/sparc/sparc.md	(working copy)
@@ -7757,7 +7757,7 @@  (define_insn "*tldo_stb_sp32"
 				     (match_operand 3 "tld_symbolic_operand" "")]
 				    UNSPEC_TLSLDO)
 			 (match_operand:SI 1 "register_operand" "r")))
-	(match_operand:QI 0 "register_operand" "=r"))]
+	(match_operand:QI 0 "register_operand" "r"))]
   "TARGET_TLS && TARGET_ARCH32"
   "stb\t%0, [%1 + %2], %%tldo_add(%3)"
   [(set_attr "type" "store")])
@@ -7767,7 +7767,7 @@  (define_insn "*tldo_stb_sp64"
 				     (match_operand 3 "tld_symbolic_operand" "")]
 				    UNSPEC_TLSLDO)
 			 (match_operand:DI 1 "register_operand" "r")))
-	(match_operand:QI 0 "register_operand" "=r"))]
+	(match_operand:QI 0 "register_operand" "r"))]
   "TARGET_TLS && TARGET_ARCH64"
   "stb\t%0, [%1 + %2], %%tldo_add(%3)"
   [(set_attr "type" "store")])
@@ -7777,7 +7777,7 @@  (define_insn "*tldo_sth_sp32"
 				     (match_operand 3 "tld_symbolic_operand" "")]
 				    UNSPEC_TLSLDO)
 			 (match_operand:SI 1 "register_operand" "r")))
-	(match_operand:HI 0 "register_operand" "=r"))]
+	(match_operand:HI 0 "register_operand" "r"))]
   "TARGET_TLS && TARGET_ARCH32"
   "sth\t%0, [%1 + %2], %%tldo_add(%3)"
   [(set_attr "type" "store")])
@@ -7787,7 +7787,7 @@  (define_insn "*tldo_sth_sp64"
 				     (match_operand 3 "tld_symbolic_operand" "")]
 				    UNSPEC_TLSLDO)
 			 (match_operand:DI 1 "register_operand" "r")))
-	(match_operand:HI 0 "register_operand" "=r"))]
+	(match_operand:HI 0 "register_operand" "r"))]
   "TARGET_TLS && TARGET_ARCH64"
   "sth\t%0, [%1 + %2], %%tldo_add(%3)"
   [(set_attr "type" "store")])
@@ -7797,7 +7797,7 @@  (define_insn "*tldo_stw_sp32"
 				     (match_operand 3 "tld_symbolic_operand" "")]
 				    UNSPEC_TLSLDO)
 			 (match_operand:SI 1 "register_operand" "r")))
-	(match_operand:SI 0 "register_operand" "=r"))]
+	(match_operand:SI 0 "register_operand" "r"))]
   "TARGET_TLS && TARGET_ARCH32"
   "st\t%0, [%1 + %2], %%tldo_add(%3)"
   [(set_attr "type" "store")])
@@ -7807,7 +7807,7 @@  (define_insn "*tldo_stw_sp64"
 				     (match_operand 3 "tld_symbolic_operand" "")]
 				    UNSPEC_TLSLDO)
 			 (match_operand:DI 1 "register_operand" "r")))
-	(match_operand:SI 0 "register_operand" "=r"))]
+	(match_operand:SI 0 "register_operand" "r"))]
   "TARGET_TLS && TARGET_ARCH64"
   "stw\t%0, [%1 + %2], %%tldo_add(%3)"
   [(set_attr "type" "store")])
@@ -7817,7 +7817,7 @@  (define_insn "*tldo_stx_sp64"
 				     (match_operand 3 "tld_symbolic_operand" "")]
 				    UNSPEC_TLSLDO)
 			 (match_operand:DI 1 "register_operand" "r")))
-	(match_operand:DI 0 "register_operand" "=r"))]
+	(match_operand:DI 0 "register_operand" "r"))]
   "TARGET_TLS && TARGET_ARCH64"
   "stx\t%0, [%1 + %2], %%tldo_add(%3)"
   [(set_attr "type" "store")])