Skip to content

Commit 1588d48

Browse files
apinski-caviumstephanosio
authored andcommitted
Fix PR 106690: enable effective_target_bswap for RISCV targets with ZBB enabled by default
While looking for testcases to quickly test, I Noticed that check_effective_target_bswap was not enabled for riscv when ZBB is enabled. This patch checks if ZBB is enabled when targeting RISCV* for bswap. OK? Ran the testsuite for riscv32-linux-gnu both with and without ZBB enabled. PR testsuite/106690 gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_bswap): Return true if riscv and ZBB ISA extension is enabled. (cherry picked from commit dec5faa) Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
1 parent 9dd0c72 commit 1588d48

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

gcc/testsuite/lib/target-supports.exp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8629,6 +8629,13 @@ proc check_effective_target_bswap { } {
86298629
|| [istarget powerpc*-*-*]
86308630
|| [istarget rs6000-*-*]
86318631
|| [istarget s390*-*-*]
8632+
|| ([istarget riscv*-*-*]
8633+
&& [check_no_compiler_messages_nocache riscv_zbb object {
8634+
#if __riscv_zbb <= 0
8635+
#error ZBB is not enabled
8636+
#endif
8637+
int i;
8638+
} ""])
86328639
|| ([istarget arm*-*-*]
86338640
&& [check_no_compiler_messages_nocache arm_v6_or_later object {
86348641
#if __ARM_ARCH < 6

0 commit comments

Comments
 (0)