[PATCH/RFA] SH: Fix gcc.dg/tls failures

Kaz Kojima kkojima@rr.iij4u.or.jp
Fri Oct 8 04:33:00 GMT 2004


Hi,

There are 3 failures on gcc.dg/tls test for sh4-unknown-linux-gnu:

FAIL: gcc.dg/tls/opt-3.c (test for excess errors)
FAIL: gcc.dg/tls/pic-1.c (test for excess errors)
FAIL: gcc.dg/tls/struct-1.c (test for excess errors)

which are ICEs.  These ICEs occur because the first argument of a few
CALL patterns for tls in sh.md aren't MEM.  The appended patch fixes
it.  Bootstrapped and regtested on mainline for sh4-unknown-linux-gnu
with no new regressions.

Regards,
	kaz
--
2004-10-07  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/sh.md (tls_global_dynamic): Use MEM pattern for the
	first argument of CALL.
	(tls_local_dynamic): Likewise.

diff -u3prN ORIG/gcc/gcc/config/sh/sh.md LOCAL/gcc/gcc/config/sh/sh.md
--- ORIG/gcc/gcc/config/sh/sh.md	Fri Sep 17 07:51:32 2004
+++ LOCAL/gcc/gcc/config/sh/sh.md	Fri Oct  8 10:31:51 2004
@@ -6869,8 +6869,8 @@
 
 (define_insn "tls_global_dynamic"
   [(set (match_operand:SI 0 "register_operand" "=&z")
-	(call (unspec:SI [(match_operand:SI 1 "" "")]
-			  UNSPEC_TLSGD)
+	(call (mem:SI (unspec:SI [(match_operand:SI 1 "" "")]
+				  UNSPEC_TLSGD))
 	      (const_int 0)))
    (use (reg:PSI FPSCR_REG))
    (use (reg:SI PIC_REG))
@@ -6898,8 +6898,8 @@ mov.l\\t1f,r4\\n\\
 
 (define_insn "tls_local_dynamic"
   [(set (match_operand:SI 0 "register_operand" "=&z")
-	(call (unspec:SI [(match_operand:SI 1 "" "")]
-			  UNSPEC_TLSLDM)
+	(call (mem:SI (unspec:SI [(match_operand:SI 1 "" "")]
+				  UNSPEC_TLSLDM))
 	      (const_int 0)))
    (use (reg:PSI FPSCR_REG))
    (use (reg:SI PIC_REG))



More information about the Gcc-patches mailing list