[gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Add explicit braces to eliminate warning.
Jeff Law
law@gcc.gnu.org
Mon Dec 4 03:42:57 GMT 2023
https://gcc.gnu.org/g:b691e63f8880736f027f498003cd005925c0077e
commit b691e63f8880736f027f498003cd005925c0077e
Author: xuli <xuli1@eswincomputing.com>
Date: Wed Nov 29 08:38:00 2023 +0000
RISC-V: Add explicit braces to eliminate warning.
../.././gcc/gcc/config/riscv/riscv.cc: In function ‘void riscv_option_override()’:
../.././gcc/gcc/config/riscv/riscv.cc:8673:6: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
if (TARGET_RVE)
^
gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_option_override): Eliminate warning.
(cherry picked from commit 73a63efcdae4b979b4a1dcff2da7d68b905453a0)
Diff:
---
gcc/config/riscv/riscv.cc | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index a4fc858fb50..2f8d391579a 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -8671,10 +8671,12 @@ riscv_option_override (void)
/* RVE requires specific ABI. */
if (TARGET_RVE)
- if (!TARGET_64BIT && riscv_abi != ABI_ILP32E)
- error ("rv32e requires ilp32e ABI");
- else if (TARGET_64BIT && riscv_abi != ABI_LP64E)
- error ("rv64e requires lp64e ABI");
+ {
+ if (!TARGET_64BIT && riscv_abi != ABI_ILP32E)
+ error ("rv32e requires ilp32e ABI");
+ else if (TARGET_64BIT && riscv_abi != ABI_LP64E)
+ error ("rv64e requires lp64e ABI");
+ }
/* Zfinx require abi ilp32, ilp32e, lp64 or lp64e. */
if (TARGET_ZFINX
More information about the Gcc-cvs
mailing list