Blame SOURCES/gcc48-pr78796.patch

003890
2016-12-14  Wilco Dijkstra  <wdijkstr@arm.com>
003890
	    Jakub Jelinek  <jakub@redhat.com>
003890
003890
	PR target/78796
003890
	* config/aarch64/aarch64.c (aarch64_classify_symbol): Merge large
003890
	model checks into switch.
003890
003890
	* gcc.dg/tls/pr78796.c: New test.
003890
003890
--- gcc/config/aarch64/aarch64.c	(revision 243645)
003890
+++ gcc/config/aarch64/aarch64.c	(revision 243646)
003890
@@ -4986,6 +4986,9 @@ aarch64_classify_symbol (rtx x,
003890
   switch (aarch64_cmodel)
003890
     {
003890
     case AARCH64_CMODEL_LARGE:
003890
+      if (aarch64_tls_symbol_p (x))
003890
+	return aarch64_classify_tls_symbol (x);
003890
+
003890
       return SYMBOL_FORCE_TO_MEM;
003890
 
003890
     case AARCH64_CMODEL_TINY:
003890
--- gcc/testsuite/gcc.dg/tls/pr78796.c	(nonexistent)
003890
+++ gcc/testsuite/gcc.dg/tls/pr78796.c	(revision 243646)
003890
@@ -0,0 +1,32 @@
003890
+/* PR target/78796 */
003890
+/* { dg-do run } */
003890
+/* { dg-options "-O2" } */
003890
+/* { dg-additional-options "-mcmodel=large" { target aarch64-*-* } } */
003890
+/* { dg-require-effective-target tls } */
003890
+
003890
+struct S { int a, b, c, d, e; };
003890
+struct S t;
003890
+__thread struct S s;
003890
+
003890
+__attribute__((used, noinline, noclone)) void
003890
+foo (int *x, int *y)
003890
+{
003890
+  asm volatile ("" : : "g" (x), "g" (y) : "memory");
003890
+  if (*x != 1 || *y != 2)
003890
+    __builtin_abort ();
003890
+}
003890
+
003890
+__attribute__((used, noinline, noclone)) void
003890
+bar (void)
003890
+{
003890
+  foo (&t.c, &s.c);
003890
+}
003890
+
003890
+int
003890
+main ()
003890
+{
003890
+  t.c = 1;
003890
+  s.c = 2;
003890
+  bar ();
003890
+  return 0;
003890
+}