--- /dev/null
+From 139fed9d29ab935b3bc5159c0bdf7b8b8a39442d Mon Sep 17 00:00:00 2001
+From: Claudiu Zissulescu <claziss@gmail.com>
+Date: Mon, 15 May 2017 05:05:27 -0400
+Subject: [PATCH] [FIX] PIC: return false for any PIC related unspecs
+
+---
+ gcc/config/arc/arc.c | 9 ++++-----
+ gcc/testsuite/gcc.target/arc/pr9001191897.c | 10 ++++++++++
+ 2 files changed, 14 insertions(+), 5 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.target/arc/pr9001191897.c
+
+diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
+index 3d53a667d37f..b00126f4d2c4 100644
+--- a/gcc/config/arc/arc.c
++++ b/gcc/config/arc/arc.c
+@@ -6056,11 +6056,8 @@ arc_legitimate_constant_p (machine_mode mode, rtx x)
+ return true;
+
+ case NEG:
+- /* Assembler does not understand -(@label@gotoff). Also, we do
+- not print such pic address constant. */
+- if (GET_CODE (XEXP (x, 0)) == UNSPEC)
+- return false;
+ return arc_legitimate_constant_p (mode, XEXP (x, 0));
++
+ case PLUS:
+ case MINUS:
+ {
+@@ -6090,7 +6087,9 @@ arc_legitimate_constant_p (machine_mode mode, rtx x)
+ case UNSPEC_TLS_IE:
+ return true;
+ default:
+- break;
++ /* Any other unspec ending here are pic related, hence the above
++ constant pic address checking returned false. */
++ return false;
+ }
+ /* Fall through. */
+
+diff --git a/gcc/testsuite/gcc.target/arc/pr9001191897.c b/gcc/testsuite/gcc.target/arc/pr9001191897.c
+new file mode 100644
+index 000000000000..2b9e1689803f
+--- /dev/null
++++ b/gcc/testsuite/gcc.target/arc/pr9001191897.c
+@@ -0,0 +1,10 @@
++/* { dg-do compile } */
++/* { dg-skip-if "" { ! { clmcpu } } } */
++/* { dg-options "-mcpu=arch2 -Os -fpic -mno-sdata -mno-indexed-loads -w" } */
++a;
++c() {
++ static char b[25];
++ for (; a >= 0; a--)
++ if (b[a])
++ b[a] = '\0';
++}
+--
+2.7.4
+