On Tue, 2025-06-10 at 16:55 +0800, mengqinggang wrote:
> From: Jiajie Chen <[email protected]>
>
> LoongArch32 does not include LDX/STX instructions, and cannot lower
> (plus (reg) (reg)) pattern. Forbid ADDRESS_REG_REG and do not emit
(mem (plus (reg) (reg)))
/* snip */
> diff --git a/gcc/testsuite/gcc.target/loongarch/array-ldx.c
> b/gcc/testsuite/gcc.target/loongarch/array-ldx.c
> new file mode 100644
> index 00000000000..0797af3bbfb
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/loongarch/array-ldx.c
> @@ -0,0 +1,6 @@
> +/* { dg-do compile } */
> +/* { dg-options "-march=loongarch32 -mabi=ilp32d -O2" } */
> +long long foo(long long *arr, long long index)
> +{
> + return arr[index];
> +}
> \ No newline at end of file
Please don't leave files with no newline at end.
--
Xi Ruoyao <[email protected]>
School of Aerospace Science and Technology, Xidian University