diff mbox

One more cprop trap_if fix, PR79194

Message ID a2b09d26-91bc-e95e-0d69-150d79b34cdd@redhat.com
State New
Headers show

Commit Message

Bernd Schmidt Jan. 27, 2017, 12:55 p.m. UTC
This PR seems to be curable by fixing up the CFG a little earlier. 
Bootstrapped and tested on x86_64-linux, and it seems to cure the 
testcase with a ppc cross. I'd appreciate if someone ran full ppc tests 
with this though. Ok?


Bernd

Comments

Pat Haugen Jan. 27, 2017, 3:40 p.m. UTC | #1
On 01/27/2017 06:55 AM, Bernd Schmidt wrote:
> I'd appreciate if someone ran full ppc tests with this though.

I've started testing it on PowerPC, will post results when I have them.

-Pat
Pat Haugen Jan. 27, 2017, 5:47 p.m. UTC | #2
On 01/27/2017 09:40 AM, Pat Haugen wrote:
> On 01/27/2017 06:55 AM, Bernd Schmidt wrote:
>> I'd appreciate if someone ran full ppc tests with this though.
> I've started testing it on PowerPC, will post results when I have them.

Bootstrap/regtest on PowerPC was fine.

-Pat
Jeff Law Jan. 27, 2017, 7:41 p.m. UTC | #3
On 01/27/2017 10:47 AM, Pat Haugen wrote:
> On 01/27/2017 09:40 AM, Pat Haugen wrote:
>> On 01/27/2017 06:55 AM, Bernd Schmidt wrote:
>>> I'd appreciate if someone ran full ppc tests with this though.
>> I've started testing it on PowerPC, will post results when I have them.
>
> Bootstrap/regtest on PowerPC was fine.
As was my ppc64 big endian bootstrap & test.  I think Bernd has signed 
off for the day, so I went ahead and committed for him.

jeff
diff mbox

Patch

	PR rtl-optimization/79194
	* cprop.c (one_cprop_pass): Move deletion of code after unconditional
	traps before call to bypass_conditional_jumps.

	PR rtl-optimization/79194
	* gcc.dg/torture/pr79194.c: New test.

Index: gcc/cprop.c
===================================================================
--- gcc/cprop.c	(revision 244817)
+++ gcc/cprop.c	(working copy)
@@ -1863,8 +1863,6 @@  one_cprop_pass (void)
 	      }
 	}
 
-      changed |= bypass_conditional_jumps ();
-
       while (!uncond_traps.is_empty ())
 	{
 	  rtx_insn *insn = uncond_traps.pop ();
@@ -1873,6 +1871,8 @@  one_cprop_pass (void)
 	  emit_barrier_after_bb (to_split);
 	}
 
+      changed |= bypass_conditional_jumps ();
+
       FREE_REG_SET (reg_set_bitmap);
       free_cprop_mem ();
     }
Index: gcc/testsuite/gcc.dg/torture/pr79194.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr79194.c	(nonexistent)
+++ gcc/testsuite/gcc.dg/torture/pr79194.c	(working copy)
@@ -0,0 +1,42 @@ 
+/* { dg-do compile } */
+
+int iw, vr;
+
+void
+d9 (unsigned int j3, long long int f5, int kp)
+{
+  int *qb = &kp;
+
+  if (kp != 0)
+    {
+      long long int oq;
+      unsigned int tl = 0;
+
+      for (j3 = 0; j3 < 1; ++j3)
+        qb = &tl;
+      goto ed;
+
+ l7:
+      oq = 1;
+      while (oq < 2)
+        oq *= j3;
+
+ ed:
+      do
+        {
+          oq -= *qb;
+          if (oq != 0)
+            {
+              long long int ie = j3 & f5;
+              int ws = (j3 != 0 && kp != 0);
+
+              tl = ie > ws;
+              iw = vr = tl;
+            }
+          else
+            tl = (kp != 0 && (0 % 0) != 0); /* { dg-warning "division by zero" } */
+        }
+      while (tl != 0);
+    }
+  goto l7;
+}