Skip to content
Snippets Groups Projects
Commit b632a516 authored by Richard Sandiford's avatar Richard Sandiford
Browse files

aarch64: Avoid bogus atomics match

The non-LSE pattern aarch64_atomic_exchange<mode> comes before the
LSE pattern aarch64_atomic_exchange<mode>_lse.  From a recog
perspective, the only difference between the patterns is that
the non-LSE one clobbers CC and needs a scratch.

However, combine and RTL-SSA can both add clobbers to make a
pattern match.  This means that if they try to rerecognise an
LSE pattern, they could end up turning it into a non-LSE pattern.
This patch adds a !TARGET_LSE test to avoid that.

This is needed to avoid a regression with later patches.

gcc/
	* config/aarch64/atomics.md (aarch64_atomic_exchange<mode>): Require
	!TARGET_LSE.
parent b44d4ff7
No related branches found
No related tags found
No related merge requests found
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
UNSPECV_ATOMIC_EXCHG)) UNSPECV_ATOMIC_EXCHG))
(clobber (reg:CC CC_REGNUM)) (clobber (reg:CC CC_REGNUM))
(clobber (match_scratch:SI 4 "=&r"))] (clobber (match_scratch:SI 4 "=&r"))]
"" "!TARGET_LSE"
"#" "#"
"&& epilogue_completed" "&& epilogue_completed"
[(const_int 0)] [(const_int 0)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment