When storing a TLS symbol to memory, always use an intermediate register to load it.
gcc/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (prepare_move_operands): Always use an
intermediate register when storing a TLS symbols.
gcc/
xxxx-xx-xx Claudiu Zissulescu <claziss@synopsys.com>
* gcc/testsuite/gcc.target/arc/tls-2.c: New test.
* gcc/testsuite/gcc.target/arc/tls-3.c: Likewise.
From-SVN: r273657
+2019-07-22 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * config/arc/arc.c (prepare_move_operands): Always use an
+ intermediate register when storing a TLS symbols.
+
2019-07-22 Stafford Horne <shorne@gmail.com>
* config/or1k/or1k.c (or1k_expand_compare): Check for int before
if (GET_CODE (operands[1]) == SYMBOL_REF)
{
enum tls_model model = SYMBOL_REF_TLS_MODEL (operands[1]);
- if (MEM_P (operands[0]) && flag_pic)
+ if (MEM_P (operands[0]))
operands[1] = force_reg (mode, operands[1]);
else if (model)
operands[1] = arc_legitimize_tls_address (operands[1], model);
+2019-07-22 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * gcc.target/arc/tls-2.c: New test.
+ * gcc.target/arc/tls-3.c: Likewise.
+
2019-07-21 Marek Polacek <polacek@redhat.com>
PR c++/67853
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+/* { dg-skip-if "" { arc*-*-elf* } } */
+/* { dg-options "-O2" } */
+
+typedef int type_a;
+__thread int b;
+int c;
+
+extern int bar (char *, int, int *, int, int *, char, type_a, int *, int *);
+int foo (int *f, char buffer, type_a buflen, int *g)
+{
+ bar("", c, (int *)foo, 1, (int *)f, buffer, buflen, (int *)g, &b);
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+/* { dg-skip-if "" { arc*-*-elf* } } */
+/* { dg-options "-Os -fPIC" } */
+
+
+typedef struct
+{
+ int(a);
+ char b[];
+} type_c;
+
+
+extern int bar (char *, int, char *);
+static _Thread_local type_c d;
+int foo(void)
+{
+ bar(d.b, 0, d.b);
+}