aarch64: Fix -mtrack-speculation for irreversible conditions [PR93341]
authorRichard Sandiford <richard.sandiford@arm.com>
Tue, 21 Jan 2020 10:31:13 +0000 (10:31 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 23 Jan 2020 13:56:16 +0000 (13:56 +0000)
commit2214053f9d9cdf66a4f3a657dbae43d293fd0387
treeb577bee03b2bfd6558950c4d49a2074c295c0bd7
parentd16db16edd35bf4f0774aafef2325e113559d910
aarch64: Fix -mtrack-speculation for irreversible conditions [PR93341]

We can't yet represent the inverse of all conditions in rtl
(see g:865257c447cc50f5819e), triggering an ICE in the pass
that handles -mtrack-speculation.  Since we don't expect these
insns to be optimised in any way, the easiest fix seemed to be
to add an insn that reverses the condition internally.

2020-01-23  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
PR target/93341
* config/aarch64/aarch64.md (UNSPEC_SPECULATION_TRACKER_REV): New
unspec.
(speculation_tracker_rev): New pattern.
* config/aarch64/aarch64-speculation.cc (aarch64_do_track_speculation):
Use speculation_tracker_rev to track the inverse condition.

gcc/testsuite/
PR target/93341
* gcc.target/aarch64/pr93341.c: New test.
gcc/ChangeLog
gcc/config/aarch64/aarch64-speculation.cc
gcc/config/aarch64/aarch64.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/pr93341.c [new file with mode: 0644]