gcc/ChangeLog:
* config/loongarch/loongarch.cc (loongarch_split_symbol):
Assign the '/u' attribute to the mem.
gcc/testsuite/ChangeLog:
* g++.target/loongarch/got-load.C: New test.
rtx mem = gen_rtx_MEM (Pmode, low);
*low_out = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, mem),
UNSPEC_LOAD_FROM_GOT);
+
+ /* Nonzero in a mem, if the memory is statically allocated and
+ read-only. A common example of the later is a shared library’s
+ global offset table. */
+ MEM_READONLY_P (mem) = 1;
}
break;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mabi=lp64d -O2 -mexplicit-relocs -mcmodel=normal -fdump-rtl-expand" } */
+/* { dg-final { scan-rtl-dump-times "mem/u" 2 "expand" } } */
+
+#include <bits/stdc++.h>
+
+using namespace std;
+
+int lr[100005][2];
+
+void
+test(void)
+{
+ int n;
+
+ cin >> n;
+ for (int i = 0; i < n; ++i)
+ cin >> lr[i][0] >> lr[i][1];
+}