aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDragan Mladjenovic <dmladjenovic@wavecomp.com>2019-10-03 19:17:20 +0000
committerDragan Mladjenovic <draganm@gcc.gnu.org>2019-10-03 19:17:20 +0000
commit206c926ae2e422b358e63b555298ac21119502ed (patch)
tree4ec939be65d2ca796a27d4d01bd2861d7ffbbab5 /gcc
parent6c7e076b746e17ab9d49255c4ba9b2d01ff997c8 (diff)
downloadgcc-206c926ae2e422b358e63b555298ac21119502ed.zip
gcc-206c926ae2e422b358e63b555298ac21119502ed.tar.gz
gcc-206c926ae2e422b358e63b555298ac21119502ed.tar.bz2
re PR target/91769 (wrong code with -O2 on MIPS)
Fix PR target/91769 This fixes the issue by checking that addr's base reg is not part of dest multiword reg instead just checking the first reg of dest. gcc/ChangeLog: 2019-10-03 Dragan Mladjenovic <dmladjenovic@wavecomp.com> PR target/91769 * config/mips/mips.c (mips_split_move): Use reg_overlap_mentioned_p instead of REGNO equality check on addr.reg. gcc/testsuite/ChangeLog: 2019-10-03 Dragan Mladjenovic <dmladjenovic@wavecomp.com> PR target/91769 * gcc.target/mips/pr91769.c: New test. From-SVN: r276525
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/mips/mips.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.target/mips/pr91769.c19
4 files changed, 31 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ff52beb..1815dc9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2019-10-03 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ PR target/91769
+ * config/mips/mips.c (mips_split_move): Use reg_overlap_mentioned_p
+ instead of REGNO equality check on addr.reg.
+
2019-10-03 Jan Hubicka <hubicka@ucw.cz>
* params.def (PARAM_INLINE_HEURISTICS_HINT_PERCENT,
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 648d95f..e7c2212 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -4862,7 +4862,7 @@ mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_)
{
rtx tmp = XEXP (src, 0);
mips_classify_address (&addr, tmp, GET_MODE (tmp), true);
- if (addr.reg && REGNO (addr.reg) != REGNO (dest))
+ if (addr.reg && !reg_overlap_mentioned_p (dest, addr.reg))
validate_change (next, &SET_SRC (set), src, false);
}
else
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d4852d3..7939c36 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-10-03 Dragan Mladjenovic <dmladjenovic@wavecomp.com>
+
+ PR target/91769
+ * gcc.target/mips/pr91769.c: New test.
+
2019-10-03 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* g++.dg/cpp0x/gen-attrs-67.C: Expect constructor priorities error
diff --git a/gcc/testsuite/gcc.target/mips/pr91769.c b/gcc/testsuite/gcc.target/mips/pr91769.c
new file mode 100644
index 0000000..c9ad70d
--- /dev/null
+++ b/gcc/testsuite/gcc.target/mips/pr91769.c
@@ -0,0 +1,19 @@
+/* PR target/91769 */
+/* { dg-do compile } */
+/* { dg-skip-if "naming registers makes this a code quality test" { *-*-* } { "-O0" "-g" } { "" } } */
+/* { dg-options "-EL -mgp32 -mhard-float" } */
+
+NOCOMPRESSION double
+foo (void)
+{
+ register double* pf __asm__ ("$a1");
+ __asm__ __volatile__ ("":"=r"(pf));
+ double f = *pf;
+
+ if (f != f)
+ f = -f;
+ return f;
+}
+
+/* { dg-final { scan-assembler-not "lw\t\\\$4,0\\(\\\$5\\)\n\tlw\t\\\$5,4\\(\\\$5\\)\n\tldc1\t\\\$.*,0\\(\\\$5\\)" } } */
+/* { dg-final { scan-assembler "lw\t\\\$4,0\\(\\\$5\\)\n\tlw\t\\\$5,4\\(\\\$5\\)\n\tmtc1\t\\\$4,\\\$.*\n\tmthc1\t\\\$5,\\\$.*" } } */