Make sure we check the constants in all cases.
gcc/
2017-10-14 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.c (arc_legitimate_constant_p): Always check all
constants.
testsuite/
2017-10-14 Claudiu Zissulescu <claziss@synopsys.com>
* gcc.target/arc/tls-1.c: New test.
From-SVN: r255778
+2017-12-18 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * config/arc/arc.c (arc_legitimate_constant_p): Always check all
+ constants.
+
2017-12-18 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
PR target/83420
bool
arc_legitimate_constant_p (machine_mode mode, rtx x)
{
- if (GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_TLS_MODEL (x))
- return false;
-
- if (!flag_pic && mode != Pmode)
- return true;
-
switch (GET_CODE (x))
{
case CONST:
+2017-12-18 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * gcc.target/arc/tls-1.c: New test.
+
2017-12-18 Richard Biener <rguenther@suse.de>
PR tree-optimization/81877
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target tls } */
+/* { dg-options "-O3 -std=gnu99" } */
+
+/* Check if addressing the `pos` member of struct is done via tls
+ mechanism. */
+
+struct callchain_cursor {
+ int last;
+ long long pos;
+} __thread a;
+void fn1(struct callchain_cursor *p1)
+{
+ p1->pos++;
+}
+
+extern void fn3 (void);
+
+void fn2(void) {
+ struct callchain_cursor *b = &a;
+ while (1) {
+ fn3();
+ fn1(b);
+ }
+}
+/* { dg-final { scan-assembler "r25,@a@tpoff" } } */