diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2025-05-13 13:50:24 -0700 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2025-05-14 07:56:22 -0700 |
commit | 9a770e52028c010f31d86d0fed3635916f5852fd (patch) | |
tree | 7b7b560c7dfec7ece6459490cea986df21d886cd /gcc | |
parent | d8d3cb676949ea3c2af5ff2d4f6c5582ce7cc9f8 (diff) | |
download | gcc-9a770e52028c010f31d86d0fed3635916f5852fd.zip gcc-9a770e52028c010f31d86d0fed3635916f5852fd.tar.gz gcc-9a770e52028c010f31d86d0fed3635916f5852fd.tar.bz2 |
gimple: Add assert for code being a comparison in gimple_cond_set_code
We have code later on that verifies the code is a comparison. So let's
try to catch it earlier. So it is easier to debug where the incorrect code
gets set.
Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
* gimple.h (gimple_cond_set_code): Add assert of the code
being a comparison.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/gimple.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h index 977ff1c..94d5a13 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -3716,6 +3716,7 @@ gimple_cond_code (const gimple *gs) inline void gimple_cond_set_code (gcond *gs, enum tree_code code) { + gcc_gimple_checking_assert (TREE_CODE_CLASS (code) == tcc_comparison); gs->subcode = code; } |