]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Fix ICE when explicit-relocs is none
authorDengJianbo <dengjianbo@loongson.cn>
Tue, 13 Jan 2026 07:21:54 +0000 (15:21 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Thu, 15 Jan 2026 02:55:27 +0000 (10:55 +0800)
commita0ee159bb584855ad2db4563b6e31f88cebe055f
tree2ca49e3f6f3ad70953611b26c5f7b8aea4642787
parenta9d1b2f8b05cb4e178b7a675640036e98c0a330b
LoongArch: Fix ICE when explicit-relocs is none

When set -mexplicit-relocs=none, the symbol address should be caclulated
by macro instructions, for example la.local. Due to the condition
TARGET_CMODEL_EXTREME in movdi_symbolic_off64, this template can not be
matched in case the cmodel is normal. If the variable has attribute
model("extreme"), gcc will get crashed with error unrecognizable insns.
This patch fix this issue by removing TARGET_CMODEL_EXTREME, since it
already checked in prediction symbolic_off64_or_reg_operand.

gcc/ChangeLog:

* config/loongarch/loongarch.md: Remove condition in template
movdi_symbolic_off64.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/la64/attr-model-6.c: New test.
gcc/config/loongarch/loongarch.md
gcc/testsuite/gcc.target/loongarch/la64/attr-model-6.c [new file with mode: 0644]