]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/88349 ([MIPS] Redundant store instructions generated start...
authorVladimir Makarov <vmakarov@redhat.com>
Fri, 7 Dec 2018 16:08:17 +0000 (16:08 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Fri, 7 Dec 2018 16:08:17 +0000 (16:08 +0000)
2018-12-07  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/88349
* ira-costs.c (record_operand_costs): Check bigger reg class on
NO_REGS.

2018-12-07  Vladimir Makarov  <vmakarov@redhat.com>

PR rtl-optimization/88349
* gcc.target/mips/pr88349.c: New.

From-SVN: r266894

gcc/ChangeLog
gcc/ira-costs.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/pr88349.c [new file with mode: 0644]

index 95c1a4a8029dfc41e5791c40fac510909c0b05b5..3bdbf563898f7b152b779112cdc5b2f39f1c6b40 100644 (file)
@@ -1,3 +1,9 @@
+2018-12-07  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/88349
+       * ira-costs.c (record_operand_costs): Check bigger reg class on
+       NO_REGS.
+
 2018-12-07  Richard Sandiford  <richard.sandiford@arm.com>
 
        * config/aarch64/aarch64-sve.md (*mul<mode>3, *v<optab><mode>3):
index d0f097bb2d545bff554bdd591a6cd5d42d5b558f..14d0ff3a9eb86362d0d4445b469fa8cafe92460c 100644 (file)
@@ -1327,8 +1327,9 @@ record_operand_costs (rtx_insn *insn, enum reg_class *pref)
             fit the the hard reg class (e.g. DImode for AREG on
             i386).  Check this and use a bigger class to get the
             right cost.  */
-         if (! ira_hard_reg_in_set_p (other_regno, mode,
-                                      reg_class_contents[hard_reg_class]))
+         if (bigger_hard_reg_class != NO_REGS
+             && ! ira_hard_reg_in_set_p (other_regno, mode,
+                                         reg_class_contents[hard_reg_class]))
            hard_reg_class = bigger_hard_reg_class;
          i = regno == (int) REGNO (src) ? 1 : 0;
          for (k = cost_classes_ptr->num - 1; k >= 0; k--)
index fd940b465b58ef615dd52a3940aeadc50e847fa8..8ad888d1fa917f73d684a629909cee9e4f03cd4f 100644 (file)
@@ -1,3 +1,8 @@
+2018-12-07  Vladimir Makarov  <vmakarov@redhat.com>
+
+       PR rtl-optimization/88349
+       * gcc.target/mips/pr88349.c: New.
+
 2018-12-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/86669
diff --git a/gcc/testsuite/gcc.target/mips/pr88349.c b/gcc/testsuite/gcc.target/mips/pr88349.c
new file mode 100644 (file)
index 0000000..f070d24
--- /dev/null
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-mel -mabi=32 -march=mips64r2 -fexpensive-optimizations" } */
+/* { dg-skip-if "code quality test" { *-*-* } { "-O0" } { "" } } */
+
+typedef int DI __attribute__((mode(DI)));
+typedef int SI __attribute__((mode(SI)));
+
+__attribute__((mips16)) SI
+f (SI x, SI y)
+{
+  return ((DI) x * y) >> 32;
+}
+
+/* { dg-final { scan-assembler-not "\tsw\t" } } */