public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@redhat.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: patch for PR88349
Date: Fri, 07 Dec 2018 16:12:00 -0000	[thread overview]
Message-ID: <d22d5a2c-28fa-280d-693f-6812a08ddf05@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

The following patch fixes

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88349

The patch is simple and therefore I checked it only on x86-64.

Committed as rev. 226894.


[-- Attachment #2: pr88349.patch --]
[-- Type: text/x-patch, Size: 2207 bytes --]

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 266893)
+++ ChangeLog	(working copy)
@@ -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: ira-costs.c
===================================================================
--- ira-costs.c	(revision 266862)
+++ ira-costs.c	(working copy)
@@ -1327,8 +1327,9 @@ record_operand_costs (rtx_insn *insn, en
 	     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: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog	(revision 266893)
+++ testsuite/ChangeLog	(working copy)
@@ -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
Index: testsuite/gcc.target/mips/pr88349.c
===================================================================
--- testsuite/gcc.target/mips/pr88349.c	(nonexistent)
+++ testsuite/gcc.target/mips/pr88349.c	(working copy)
@@ -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" } } */

                 reply	other threads:[~2018-12-07 16:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d22d5a2c-28fa-280d-693f-6812a08ddf05@redhat.com \
    --to=vmakarov@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).