public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-9006] sparc: Add NOP in stack_protect_setsi if sparc_fix_b2bst enabled
@ 2021-09-16 11:44 Daniel Hellstrom
0 siblings, 0 replies; only message in thread
From: Daniel Hellstrom @ 2021-09-16 11:44 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:3fd9656951bc88e20d475c989c03d5da507b973b
commit r11-9006-g3fd9656951bc88e20d475c989c03d5da507b973b
Author: Daniel Cederman <cederman@gaisler.com>
Date: Thu Oct 1 09:11:38 2020 +0200
sparc: Add NOP in stack_protect_setsi if sparc_fix_b2bst enabled
This is needed to prevent the Store -> (Non-store or load) -> Store
sequence.
gcc/ChangeLog:
* config/sparc/sparc.md (stack_protect_setsi): Add NOP to prevent
sensitive sequence for B2BST errata workaround.
Diff:
---
gcc/config/sparc/sparc.md | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index c5d369626cc..2c53ec8fb41 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -8353,9 +8353,15 @@ visl")
(unspec:SI [(match_operand:SI 1 "memory_operand" "m")] UNSPEC_SP_SET))
(set (match_scratch:SI 2 "=&r") (const_int 0))]
"TARGET_ARCH32"
- "ld\t%1, %2\;st\t%2, %0\;mov\t0, %2"
+{
+ if (sparc_fix_b2bst)
+ return "ld\t%1, %2\;st\t%2, %0\;mov\t0, %2\;nop";
+ else
+ return "ld\t%1, %2\;st\t%2, %0\;mov\t0, %2";
+}
[(set_attr "type" "multi")
- (set_attr "length" "3")])
+ (set (attr "length") (if_then_else (eq_attr "fix_b2bst" "true")
+ (const_int 4) (const_int 3)))])
(define_insn "stack_protect_setdi"
[(set (match_operand:DI 0 "memory_operand" "=m")
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-16 11:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 11:44 [gcc r11-9006] sparc: Add NOP in stack_protect_setsi if sparc_fix_b2bst enabled Daniel Hellstrom
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).