public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* patch to fix PR78580
@ 2016-12-21 22:34 Vladimir N Makarov
  0 siblings, 0 replies; only message in thread
From: Vladimir N Makarov @ 2016-12-21 22:34 UTC (permalink / raw)
  To: gcc-patches

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

   The following patch fixes

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

The patch was successfully tested and bootstrapped on x86-64.

Committed to the trunk as rev. 243875.



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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 243873)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2016-12-21  Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/78580
+	* ira-costs.c (find_costs_and_classes): Make regno_aclass
+	translated into an allocno class.
+
 2016-12-21  Pat Haugen  <pthaugen@us.ibm.com>
 
 	PR rtl-optimization/11488
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog	(revision 243873)
+++ testsuite/ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2016-12-21  Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/78580
+	* gcc.target/i386/pr78580.c: New.
+
 2016-12-21  Jakub Jelinek  <jakub@redhat.com>
 
 	PR c++/77830
Index: ira-costs.c
===================================================================
--- ira-costs.c	(revision 243533)
+++ ira-costs.c	(working copy)
@@ -1846,14 +1846,19 @@ find_costs_and_classes (FILE *dump_file)
 	       short in -O0 code and so register pressure tends to be low.
 
 	       Avoid that by ignoring the alternative class if the best
-	       class has plenty of registers.  */
-	    regno_aclass[i] = best;
+	       class has plenty of registers.
+
+	       The union class arrays give important classes and only
+	       part of it are allocno classes.  So translate them into
+	       allocno classes.  */
+	    regno_aclass[i] = ira_allocno_class_translate[best];
 	  else
 	    {
 	      /* Make the common class the biggest class of best and
-		 alt_class.  */
-	      regno_aclass[i]
-		= ira_reg_class_superunion[best][alt_class];
+		 alt_class.  Translate the common class into an
+		 allocno class too.  */
+	      regno_aclass[i] = (ira_allocno_class_translate
+				 [ira_reg_class_superunion[best][alt_class]]);
 	      ira_assert (regno_aclass[i] != NO_REGS
 			  && ira_reg_allocno_class_p[regno_aclass[i]]);
 	    }
Index: testsuite/gcc.target/i386/pr78580.c
===================================================================
--- testsuite/gcc.target/i386/pr78580.c	(nonexistent)
+++ testsuite/gcc.target/i386/pr78580.c	(working copy)
@@ -0,0 +1,18 @@
+/* PR rtl-optimization/78580 */
+/* { dg-do compile } */
+/* { dg-options "-O0 -ffixed-ebx" } */
+
+extern const signed char a;
+
+int
+foo (signed char x)
+{
+  return x;
+}
+
+int
+main ()
+{
+  foo (a);
+  return 0;
+}

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-21 22:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-21 22:34 patch to fix PR78580 Vladimir N Makarov

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).