aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-12-12 11:40:28 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-12-12 11:40:28 +0000
commitbf4eca2e562d036f109f1782e95b233453b0d503 (patch)
treeeba67c59329144a5a95f7b2dac92239b462a7be7
parent9c47a019948f5caf12e7726001e15fefcb32d065 (diff)
downloadgcc-bf4eca2e562d036f109f1782e95b233453b0d503.zip
gcc-bf4eca2e562d036f109f1782e95b233453b0d503.tar.gz
gcc-bf4eca2e562d036f109f1782e95b233453b0d503.tar.bz2
re PR target/86806 (SPARC port needs updating for CVE-2017-5753)
PR target/86806 * config/sparc/sparc.md (unspecv): Add UNSPECV_SPECULATION_BARRIER. (speculation_barrier): New instruction for V9. From-SVN: r267053
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sparc/sparc.md11
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2a6916b..2026219 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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>
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index df76940..431993c 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -104,6 +104,9 @@
(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))]
""