aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMihailo Stojanovic <mistojanovic@wavecomp.com>2019-10-14 21:07:56 +0000
committerJeff Law <law@gcc.gnu.org>2019-10-14 15:07:56 -0600
commit4236e880ee7902f789f8b99e21faea33ecb8a6dd (patch)
tree25e3511ed0b713647b3ec1d9f580dc30656c0597 /gcc
parentac308262f344153d472b16c85cc1c3036ce43308 (diff)
downloadgcc-4236e880ee7902f789f8b99e21faea33ecb8a6dd.zip
gcc-4236e880ee7902f789f8b99e21faea33ecb8a6dd.tar.gz
gcc-4236e880ee7902f789f8b99e21faea33ecb8a6dd.tar.bz2
mips.c (mips_cannot_force_const_mem): Reject vector constants.
* config/mips/mips.c (mips_cannot_force_const_mem): Reject vector constants. * gcc.target/mips/constant-spill.c: New test. From-SVN: r276969
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.c3
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/mips/constant-spill.c31
4 files changed, 42 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index adc3550..516e9c1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2019-10-14 Mihailo Stojanovic <mistojanovic@wavecomp.com>
+
+ * config/mips/mips.c (mips_cannot_force_const_mem): Reject
+ vector constants.
+
2019-10-14 Iain Sandoe <iain@sandoe.co.uk>
* config/darwin.c: Use unsigned ints for the picbase label
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index e7c2212..7f6a0db 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -2409,7 +2409,8 @@ mips_cannot_force_const_mem (machine_mode mode, rtx x)
references, reload will consider forcing C into memory and using
one of the instruction's memory alternatives. Returning false
here will force it to use an input reload instead. */
- if (CONST_INT_P (x) && mips_legitimate_constant_p (mode, x))
+ if ((CONST_INT_P (x) || GET_CODE (x) == CONST_VECTOR)
+ && mips_legitimate_constant_p (mode, x))
return true;
split_const (x, &base, &offset);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 281da7f..08d4a79 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2019-10-14 Mihailo Stojanovic <mistojanovic@wavecomp.com>
+
+ * gcc.target/mips/constant-spill.c: New test.
+
2019-10-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/92069
diff --git a/gcc/testsuite/gcc.target/mips/constant-spill.c b/gcc/testsuite/gcc.target/mips/constant-spill.c
new file mode 100644
index 0000000..1494705
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/constant-spill.c
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-mfp64 -mhard-float -mmsa" } */
+/* { dg-skip-if "code quality test" { *-*-* } { "-Os" "-O0" "-O1" "-O2" } { "" } } */
+
+void foo (void);
+
+void bar (void)
+{
+ int x[4];
+ int y[4];
+ int i;
+
+ while (1)
+ {
+ foo ();
+
+ for (i = 0; i < 4; i++)
+ {
+ x[i] = 0;
+ y[i] = 0;
+ }
+
+ asm volatile (""
+ :
+ :"m"(x), "m"(y)
+ :"memory");
+ }
+}
+
+/* { dg-final { scan-assembler-not "ld.w" } } */
+/* { dg-final { scan-assembler-times "st.w" 2 } } */