aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2024-06-12 11:01:53 +0800
committerXi Ruoyao <xry111@xry111.site>2024-06-12 20:38:09 +0800
commit53c703888eb51314f762c8998dc9215871b12722 (patch)
treead52c34c789f40975fb7ce1c109e9ae06b2e50d8 /gcc
parent7663154c93a0193e88e1d8a1f24e4617dcaf9058 (diff)
downloadgcc-53c703888eb51314f762c8998dc9215871b12722.zip
gcc-53c703888eb51314f762c8998dc9215871b12722.tar.gz
gcc-53c703888eb51314f762c8998dc9215871b12722.tar.bz2
LoongArch: Fix mode size comparision in loongarch_expand_conditional_move
We were comparing a mode size with word_mode, but word_mode is an enum value thus this does not really make any sense. (Un)luckily E_DImode happens to be 8 so this seemed to work, but let's make it correct so it won't blow up when we add LA32 support or add another machine mode... gcc/ChangeLog: * config/loongarch/loongarch.cc (loongarch_expand_conditional_move): Compare mode size with UNITS_PER_WORD instead of word_mode.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/loongarch/loongarch.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc
index 1b6df6a..6ec3ee6 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -5352,7 +5352,7 @@ loongarch_expand_conditional_move (rtx *operands)
loongarch_emit_float_compare (&code, &op0, &op1);
else
{
- if (GET_MODE_SIZE (GET_MODE (op0)) < word_mode)
+ if (GET_MODE_SIZE (GET_MODE (op0)) < UNITS_PER_WORD)
{
promote_op[0] = (REG_P (op0) && REG_P (operands[2]) &&
REGNO (op0) == REGNO (operands[2]));