summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-26 20:36:07 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-26 20:36:07 +0000
commitcfd199cb6a4a5c9317d1ccf52dbaa324163de2c5 (patch)
treeb748bff788bf3e80d6ef0a86bc289b4fad31dbf1 /gcc
parent6b2c69ce9147f6bbe3e75c9a7b6433733166bf98 (diff)
downloadgcc-cfd199cb6a4a5c9317d1ccf52dbaa324163de2c5.tar.gz
* doc/invoke.texi: Document -mTLS.
* testsuite/gcc.target/frv/all-tls-global-dynamic.c: New. * testsuite/gcc.target/frv/all-tls-initial-exec.c: New. * testsuite/gcc.target/frv/all-tls-initial-exec-pic.c: New. * testsuite/gcc.target/frv/all-tls-local-dynamic.c: New. * testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c: New. * testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c: New. * testsuite/gcc.target/frv/all-tls-local-exec.c: New. * testsuite/gcc.target/frv/all-tls-local-exec-TLS.c: New. * configure.ac: Check for a TLS capable gas. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94283 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog16
-rwxr-xr-xgcc/configure9
-rw-r--r--gcc/configure.ac9
-rw-r--r--gcc/doc/invoke.texi11
-rw-r--r--gcc/testsuite/gcc.target/frv/all-tls-global-dynamic.c12
-rw-r--r--gcc/testsuite/gcc.target/frv/all-tls-initial-exec-pic.c12
-rw-r--r--gcc/testsuite/gcc.target/frv/all-tls-initial-exec.c12
-rw-r--r--gcc/testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c13
-rw-r--r--gcc/testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c12
-rw-r--r--gcc/testsuite/gcc.target/frv/all-tls-local-dynamic.c13
-rw-r--r--gcc/testsuite/gcc.target/frv/all-tls-local-exec-TLS.c12
-rw-r--r--gcc/testsuite/gcc.target/frv/all-tls-local-exec.c12
12 files changed, 143 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 630dfac2abe..51d5111b9b2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,19 @@
+2005-01-26 Aldy Hernandez <aldyh@redhat.com>
+
+ * doc/invoke.texi: Document -mTLS.
+
+ * testsuite/gcc.target/frv/all-tls-global-dynamic.c: New.
+ * testsuite/gcc.target/frv/all-tls-initial-exec.c: New.
+ * testsuite/gcc.target/frv/all-tls-initial-exec-pic.c: New.
+ * testsuite/gcc.target/frv/all-tls-local-dynamic.c: New.
+ * testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c: New.
+ * testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c: New.
+ * testsuite/gcc.target/frv/all-tls-local-exec.c: New.
+ * testsuite/gcc.target/frv/all-tls-local-exec-TLS.c: New.
+
+ * configure.ac: Check for a TLS capable gas.
+
+ * configure: Regenerate.
2005-01-26 Richard Henderson <rth@redhat.com>
PR middle-end/18008
diff --git a/gcc/configure b/gcc/configure
index 220fcafa117..08868418fd2 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -13690,6 +13690,15 @@ foo: .long 25
tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
+ frv*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+x: .long 25
+ .text
+ call #gettlsoff(x)'
+ tls_first_major=2
+ tls_first_minor=14
+ ;;
i[34567]86-*-*)
conftest_s='
.section ".tdata","awT",@progbits
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 59524c21cf3..937676a573f 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2279,6 +2279,15 @@ foo: .long 25
tls_first_minor=13
tls_as_opt=--fatal-warnings
;;
+ frv*-*-*)
+ conftest_s='
+ .section ".tdata","awT",@progbits
+x: .long 25
+ .text
+ call #gettlsoff(x)'
+ tls_first_major=2
+ tls_first_minor=14
+ ;;
i[34567]86-*-*)
conftest_s='
.section ".tdata","awT",@progbits
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 7013bb2e29e..a48fac1142d 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -461,6 +461,7 @@ Objective-C and Objective-C++ Dialects}.
-mvliw-branch -mno-vliw-branch @gol
-mmulti-cond-exec -mno-multi-cond-exec -mnested-cond-exec @gol
-mno-nested-cond-exec -mtomcat-stats @gol
+-mTLS -mtls @gol
-mcpu=@var{cpu}}
@emph{H8/300 Options}
@@ -7872,6 +7873,16 @@ shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
optimization option such as @option{-O3} or above is present in the
command line.
+@item -mTLS
+@opindex TLS
+
+Assume a large TLS segment when generating thread-local code.
+
+@item -mtls
+@opindex tls
+
+Do not assume a large TLS segment when generating thread-local code.
+
@item -mgprel-ro
@opindex mgprel-ro
diff --git a/gcc/testsuite/gcc.target/frv/all-tls-global-dynamic.c b/gcc/testsuite/gcc.target/frv/all-tls-global-dynamic.c
new file mode 100644
index 00000000000..2135090f134
--- /dev/null
+++ b/gcc/testsuite/gcc.target/frv/all-tls-global-dynamic.c
@@ -0,0 +1,12 @@
+/* { dg-options "-ftls-model=global-dynamic -fpic -mfdpic -mno-inline-plt" } */
+/* { dg-do compile } */
+extern __thread int x;
+extern void bar ();
+int *y;
+
+void foo (void)
+{
+ bar ();
+ y = &x;
+}
+/* { dg-final { scan-assembler "call #gettlsoff.x." } } */
diff --git a/gcc/testsuite/gcc.target/frv/all-tls-initial-exec-pic.c b/gcc/testsuite/gcc.target/frv/all-tls-initial-exec-pic.c
new file mode 100644
index 00000000000..b51e34df63c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/frv/all-tls-initial-exec-pic.c
@@ -0,0 +1,12 @@
+/* { dg-options "-ftls-model=initial-exec -fpic -mfdpic" } */
+/* { dg-do compile } */
+extern __thread int x;
+extern void bar ();
+int *y;
+
+void foo (void)
+{
+ bar ();
+ y = &x;
+}
+/* { dg-final { scan-assembler "ld.*#gottlsoff12" } } */
diff --git a/gcc/testsuite/gcc.target/frv/all-tls-initial-exec.c b/gcc/testsuite/gcc.target/frv/all-tls-initial-exec.c
new file mode 100644
index 00000000000..fa755a2991c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/frv/all-tls-initial-exec.c
@@ -0,0 +1,12 @@
+/* { dg-options "-ftls-model=initial-exec -mfdpic" } */
+/* { dg-do compile } */
+extern __thread int x;
+extern void bar ();
+int *y;
+
+void foo (void)
+{
+ bar ();
+ y = &x;
+}
+/* { dg-final { scan-assembler "ld.*#tlsoff.x.@" } } */
diff --git a/gcc/testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c b/gcc/testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c
new file mode 100644
index 00000000000..3eabe1c6bf0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/frv/all-tls-local-dynamic-plt-pic.c
@@ -0,0 +1,13 @@
+/* { dg-options "-ftls-model=local-dynamic -minline-plt -fpic -mfdpic" } */
+/* { dg-do compile } */
+static __thread int x;
+extern void bar ();
+int *y;
+
+void foo (void)
+{
+ bar ();
+ y = &x;
+}
+/* { dg-final { scan-assembler "lddi.*gottlsdesc12" } } */
+/* { dg-final { scan-assembler "calll.*#gettlsoff\\(0\\)" } } */
diff --git a/gcc/testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c b/gcc/testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c
new file mode 100644
index 00000000000..5c2de93847f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/frv/all-tls-local-dynamic-plt.c
@@ -0,0 +1,12 @@
+/* { dg-options "-ftls-model=local-dynamic -minline-plt -fPIC -mfdpic" } */
+/* { dg-do compile } */
+static __thread int x;
+extern void bar ();
+int *y;
+
+void foo (void)
+{
+ bar ();
+ y = &x;
+}
+/* { dg-final { scan-assembler "ldd.*tlsdesc\\(0\\)@" } } */
diff --git a/gcc/testsuite/gcc.target/frv/all-tls-local-dynamic.c b/gcc/testsuite/gcc.target/frv/all-tls-local-dynamic.c
new file mode 100644
index 00000000000..4680a98f4ea
--- /dev/null
+++ b/gcc/testsuite/gcc.target/frv/all-tls-local-dynamic.c
@@ -0,0 +1,13 @@
+/* { dg-options "-ftls-model=local-dynamic -fpic -mfdpic" } */
+/* { dg-do compile } */
+static __thread int x;
+extern void bar ();
+int *y;
+
+void foo (void)
+{
+ bar ();
+ y = &x;
+}
+/* { dg-final { scan-assembler "gettlsoff\\(0\\)" } } */
+/* { dg-final { scan-assembler "tlsmoff12" } } */
diff --git a/gcc/testsuite/gcc.target/frv/all-tls-local-exec-TLS.c b/gcc/testsuite/gcc.target/frv/all-tls-local-exec-TLS.c
new file mode 100644
index 00000000000..83f78de4e76
--- /dev/null
+++ b/gcc/testsuite/gcc.target/frv/all-tls-local-exec-TLS.c
@@ -0,0 +1,12 @@
+/* { dg-options "-ftls-model=local-exec -mfdpic -mTLS" } */
+/* { dg-do compile } */
+static __thread int x;
+extern void bar ();
+int *y;
+
+void foo (void)
+{
+ bar ();
+ y = &x;
+}
+/* { dg-final { scan-assembler "sethi.*tlsmoffhi\\(x\\)," } } */
diff --git a/gcc/testsuite/gcc.target/frv/all-tls-local-exec.c b/gcc/testsuite/gcc.target/frv/all-tls-local-exec.c
new file mode 100644
index 00000000000..dd1b86a0556
--- /dev/null
+++ b/gcc/testsuite/gcc.target/frv/all-tls-local-exec.c
@@ -0,0 +1,12 @@
+/* { dg-options "-ftls-model=local-exec -mfdpic" } */
+/* { dg-do compile } */
+static __thread int x;
+extern void bar ();
+int *y;
+
+void foo (void)
+{
+ bar ();
+ y = &x;
+}
+/* { dg-final { scan-assembler ".*tlsmoff12" } } */