diff options
author | Daniel Cederman <cederman@gaisler.com> | 2020-10-01 09:11:38 +0200 |
---|---|---|
committer | Daniel Hellstrom <daniel@gaisler.com> | 2021-09-16 13:05:51 +0200 |
commit | a053dab90e69c2a8289c95caec236f239a2a764b (patch) | |
tree | 91541a393a4b7530721903fbd40afe0cfa2e981a | |
parent | d4aa16699d4bcf9d335a206d3d8f6c1a80142aab (diff) | |
download | gcc-a053dab90e69c2a8289c95caec236f239a2a764b.zip gcc-a053dab90e69c2a8289c95caec236f239a2a764b.tar.gz gcc-a053dab90e69c2a8289c95caec236f239a2a764b.tar.bz2 |
sparc: Add NOP in stack_protect_set32 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_set32): Add NOP to prevent
sensitive sequence for B2BST errata workaround.
-rw-r--r-- | gcc/config/sparc/sparc.md | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index 24b76e0..3ac074a 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_set64" [(set (match_operand:DI 0 "memory_operand" "=m") |