diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e2afb1f94737b14275e89914e1203c8279b8e935..4560dd8f668707bcd78d338f9a1194bf798f25ff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2018-04-30  Claudiu Zissulescu  <claziss@synopsys.com>
+
+	* config/arc/linux.h (CLEAR_INSN_CACHE): Define.
+
 2018-04-30  Claudiu Zissulescu  <claziss@synopsys.com>
 
 	* config/arc/arc-protos.h (prepare_extend_operands): Remove.
diff --git a/gcc/config/arc/linux.h b/gcc/config/arc/linux.h
index 4e87dfe3ac131da703666d205ac74ef8850022e3..96d548eae3416ac71688d581addb6ca15e0e7076 100644
--- a/gcc/config/arc/linux.h
+++ b/gcc/config/arc/linux.h
@@ -109,3 +109,17 @@ along with GCC; see the file COPYING3.  If not see
 /* Build attribute: procedure call standard.  */
 #undef ATTRIBUTE_PCS
 #define ATTRIBUTE_PCS 3
+
+/* Clear the instruction cache from `beg' to `end'.  This makes an
+   inline system call to SYS_cacheflush.  */
+#undef CLEAR_INSN_CACHE
+#define CLEAR_INSN_CACHE(beg, end)					\
+{									\
+  register unsigned long _beg __asm ("r0") = (unsigned long) (beg);	\
+  register unsigned long _end __asm ("r1") = (unsigned long) (end);	\
+  register unsigned long _xtr __asm ("r2") = 0;				\
+  register unsigned long _scno __asm ("r8") = 244;			\
+  __asm __volatile ("trap_s 0		; sys_cache_sync"		\
+		    : "=r" (_beg)					\
+		    : "0" (_beg), "r" (_end), "r" (_xtr), "r" (_scno));	\
+}