re PR target/86806 (SPARC port needs updating for CVE-2017-5753)
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 12 Dec 2018 11:40:28 +0000 (11:40 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 12 Dec 2018 11:40:28 +0000 (11:40 +0000)
PR target/86806
* config/sparc/sparc.md (unspecv): Add UNSPECV_SPECULATION_BARRIER.
(speculation_barrier): New instruction for V9.

From-SVN: r267053

gcc/ChangeLog
gcc/config/sparc/sparc.md

index 2a6916b95ac1d15cd7e575137f817088d986dc8d..2026219238f8bc7d0616cc322c13f7c6a751c7dc 100644 (file)
@@ -1,3 +1,9 @@
+2018-12-12  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR target/86806
+       * config/sparc/sparc.md (unspecv): Add UNSPECV_SPECULATION_BARRIER.
+       (speculation_barrier): New instruction for V9.
+
 2018-12-12 Segher Boessenkool  <segher@kernel.crashing.org>
           Iain Sandoe  <iain@sandoe.co.uk>
 
index df769405190388ca4e684fff9e2dc5a3bee653e5..431993cd70fe148042b65b6799710e6e747dfc70 100644 (file)
 
 (define_c_enum "unspecv" [
   UNSPECV_BLOCKAGE
+
+  UNSPECV_SPECULATION_BARRIER
+
   UNSPECV_PROBE_STACK_RANGE
 
   UNSPECV_FLUSHW
@@ -7309,6 +7312,14 @@ visl")
   ""
   [(set_attr "length" "0")])
 
+;; We use membar #Sync for the speculation barrier on V9.
+
+(define_insn "speculation_barrier"
+  [(unspec_volatile [(const_int 0)] UNSPECV_SPECULATION_BARRIER)]
+  "TARGET_V9"
+  "membar\t64"
+  [(set_attr "type" "multi")])
+
 (define_expand "probe_stack"
   [(set (match_operand 0 "memory_operand" "") (const_int 0))]
   ""