diff mbox series

patch to fix PR87759

Message ID 7dea6935-d280-1920-e855-e6281e3d773d@redhat.com
State New
Headers show
Series patch to fix PR87759 | expand

Commit Message

Vladimir Makarov Dec. 18, 2018, 9:23 p.m. UTC
The following patch fixes

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

   The patch was bootstrapped and tested on x86-64.

Committed as rev. 267244.

Comments

Jakub Jelinek Dec. 18, 2018, 9:50 p.m. UTC | #1
On Tue, Dec 18, 2018 at 04:23:12PM -0500, Vladimir Makarov wrote:
>   The following patch fixes
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87759
> 
>   The patch was bootstrapped and tested on x86-64.
> 
> Committed as rev. 267244.

The test FAILs on i686-linux, fixed thusly, committed as obvious:

2018-12-18  Jakub Jelinek  <jakub@redhat.com>

	PR rtl-optimization/87759
	* gcc.target/i386/pr87759.c: Require int128 effective target.

--- gcc/testsuite/gcc.target/i386/pr87759.c.jj	2018-12-18 22:45:00.968103777 +0100
+++ gcc/testsuite/gcc.target/i386/pr87759.c	2018-12-18 22:47:29.879712883 +0100
@@ -1,5 +1,5 @@
 /* PR rtl-optimization/87759 */
-/* { dg-do compile } */
+/* { dg-do compile { target int128 } } */
 /* { dg-options "-O2 -w -fschedule-insns -fselective-scheduling -ftrapv -fno-dce -fno-expensive-optimizations -fno-ipa-ra -fno-tree-dce -fno-tree-ter" } */
 
 int cc;

	Jakub
Vladimir Makarov Dec. 18, 2018, 9:57 p.m. UTC | #2
On 12/18/18 4:50 PM, Jakub Jelinek wrote:
> On Tue, Dec 18, 2018 at 04:23:12PM -0500, Vladimir Makarov wrote:
>>    The following patch fixes
>>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87759
>>
>>    The patch was bootstrapped and tested on x86-64.
>>
>> Committed as rev. 267244.
> The test FAILs on i686-linux, fixed thusly, committed as obvious:
>
> 2018-12-18  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR rtl-optimization/87759
> 	* gcc.target/i386/pr87759.c: Require int128 effective target.
>
> --- gcc/testsuite/gcc.target/i386/pr87759.c.jj	2018-12-18 22:45:00.968103777 +0100
> +++ gcc/testsuite/gcc.target/i386/pr87759.c	2018-12-18 22:47:29.879712883 +0100
> @@ -1,5 +1,5 @@
>   /* PR rtl-optimization/87759 */
> -/* { dg-do compile } */
> +/* { dg-do compile { target int128 } } */
>   /* { dg-options "-O2 -w -fschedule-insns -fselective-scheduling -ftrapv -fno-dce -fno-expensive-optimizations -fno-ipa-ra -fno-tree-dce -fno-tree-ter" } */
>   
>   int cc;
>
> 	

Thank you, Jakub.  I should have tested i686 target too.  Sorry about that.
diff mbox series

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 267243)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@ 
+2018-12-18  Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/87759
+	* lra-assigns.c (lra_split_hard_reg_for): Recalculate
+	non_reload_pseudos.
+
 2018-12-18  Jakub Jelinek  <jakub@redhat.com>
 
 	PR target/88464
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog	(revision 267243)
+++ testsuite/ChangeLog	(working copy)
@@ -1,3 +1,8 @@ 
+2018-12-18  Vladimir Makarov  <vmakarov@redhat.com>
+
+	PR rtl-optimization/87759
+	* gcc.target/i386/pr87759.c: New.
+
 2018-12-18  Jakub Jelinek  <jakub@redhat.com>
 
 	PR target/88464
Index: lra-assigns.c
===================================================================
--- lra-assigns.c	(revision 267135)
+++ lra-assigns.c	(working copy)
@@ -1758,6 +1758,10 @@  lra_split_hard_reg_for (void)
 	     "\n****** Splitting a hard reg after assignment #%d: ******\n\n",
 	     lra_assignment_iter);
   bitmap_initialize (&failed_reload_pseudos, &reg_obstack);
+  bitmap_initialize (&non_reload_pseudos, &reg_obstack);
+  bitmap_ior (&non_reload_pseudos, &lra_inheritance_pseudos, &lra_split_regs);
+  bitmap_ior_into (&non_reload_pseudos, &lra_subreg_reload_pseudos);
+  bitmap_ior_into (&non_reload_pseudos, &lra_optional_reload_pseudos);
   for (i = lra_constraint_new_regno_start; i < max_regno; i++)
     if (reg_renumber[i] < 0 && lra_reg_info[i].nrefs != 0
 	&& (rclass = lra_get_allocno_class (i)) != NO_REGS
@@ -1772,6 +1776,7 @@  lra_split_hard_reg_for (void)
 	  }
 	bitmap_set_bit (&failed_reload_pseudos, i);
       }
+  bitmap_clear (&non_reload_pseudos);
   bitmap_initialize (&failed_reload_insns, &reg_obstack);
   EXECUTE_IF_SET_IN_BITMAP (&failed_reload_pseudos, 0, u, bi)
     {
Index: testsuite/gcc.target/i386/pr87759.c
===================================================================
--- testsuite/gcc.target/i386/pr87759.c	(nonexistent)
+++ testsuite/gcc.target/i386/pr87759.c	(working copy)
@@ -0,0 +1,39 @@ 
+/* PR rtl-optimization/87759 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -w -fschedule-insns -fselective-scheduling -ftrapv -fno-dce -fno-expensive-optimizations -fno-ipa-ra -fno-tree-dce -fno-tree-ter" } */
+
+int cc;
+
+void
+rc (__int128 *oi)
+{
+  __int128 qz = (__int128)2 << cc;
+
+  if (qz != 0)
+    {
+      if (cc != 0)
+        {
+          __int128 zp = 1;
+
+          for (;;)
+            {
+              unsigned __int128 *ar = &cc;
+              int y5;
+
+              if (oi != 0)
+                {
+ y3:
+                  zp = *oi + *ar;
+                }
+
+              y5 = (cc + 1) == ((*ar /= *oi) << ((zp >>= 128) / cc));
+              qz += !!y5 ? 1 : qz == (*ar ^ zp + 1);
+              ++*oi;
+            }
+        }
+      else
+        ++qz;
+    }
+
+  goto y3;
+}