public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR91162
@ 2019-07-15 13:30 Richard Biener
  2019-07-16  9:30 ` Rainer Orth
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Biener @ 2019-07-15 13:30 UTC (permalink / raw)
  To: gcc-patches


Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.

Richard.

2019-07-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/91162
	* tree-cfg.c (move_block_to_fn): When releasing a virtual PHI
	node make sure to replace all uses with something valid.

	* gcc.dg/autopar/pr91162.c: New testcase.

Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c	(revision 273490)
+++ gcc/tree-cfg.c	(working copy)
@@ -7088,7 +7088,14 @@ move_block_to_fn (struct function *dest_
       if (virtual_operand_p (op))
 	{
 	  /* Remove the phi nodes for virtual operands (alias analysis will be
-	     run for the new function, anyway).  */
+	     run for the new function, anyway).  But replace all uses that
+	     might be outside of the region we move.  */
+	  use_operand_p use_p;
+	  imm_use_iterator iter;
+	  gimple *use_stmt;
+	  FOR_EACH_IMM_USE_STMT (use_stmt, iter, op)
+	    FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+	      SET_USE (use_p, SSA_NAME_VAR (op));
           remove_phi_node (&psi, true);
 	  continue;
 	}
Index: gcc/testsuite/gcc.dg/autopar/pr91162.c
===================================================================
--- gcc/testsuite/gcc.dg/autopar/pr91162.c	(nonexistent)
+++ gcc/testsuite/gcc.dg/autopar/pr91162.c	(working copy)
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O -ftree-parallelize-loops=2 -fno-tree-dominator-opts --param parloops-min-per-thread=30" } */
+
+void
+zf (__int128 ct)
+{
+  __int128 *rk = &ct;
+
+  if (0)
+    {
+      int jj;
+
+t9:
+      for (jj = 0; jj < 60; ++jj)
+	{
+	}
+
+      __builtin_unreachable ();
+    }
+
+  while (*rk < 1)
+    ++*rk;
+
+  goto t9;
+}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix PR91162
  2019-07-15 13:30 [PATCH] Fix PR91162 Richard Biener
@ 2019-07-16  9:30 ` Rainer Orth
  0 siblings, 0 replies; 2+ messages in thread
From: Rainer Orth @ 2019-07-16  9:30 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

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

Hi Richard,

> 2019-07-15  Richard Biener  <rguenther@suse.de>
>
> 	PR middle-end/91162
> 	* tree-cfg.c (move_block_to_fn): When releasing a virtual PHI
> 	node make sure to replace all uses with something valid.
>
> 	* gcc.dg/autopar/pr91162.c: New testcase.

the new testcase FAILs on several 32-bit targets,
e.g. i386-pc-solaris2.11, sparc-sun-solaris2.11 (for the 32-bit multilib
only):

FAIL: gcc.dg/autopar/pr91162.c (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/autopar/pr91162.c:5:5: error: expected declaration specifiers or '...' before '__int128'

Fixed as follows.  Tested on i386-pc-solaris2.11 and
sparc-sun-solaris2.11, installed on mainline.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2019-07-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.dg/autopar/pr91162.c: Require int128 support.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: testsuite-pr91162-int128.patch --]
[-- Type: text/x-patch, Size: 513 bytes --]

# HG changeset patch
# Parent  0c86910b64573bef93e5131552f5893f8b5fc1f0
Require int128 support in gcc.dg/autopar/pr91162.c

diff --git a/gcc/testsuite/gcc.dg/autopar/pr91162.c b/gcc/testsuite/gcc.dg/autopar/pr91162.c
--- a/gcc/testsuite/gcc.dg/autopar/pr91162.c
+++ b/gcc/testsuite/gcc.dg/autopar/pr91162.c
@@ -1,4 +1,4 @@
-/* { dg-do compile } */
+/* { dg-do compile { target int128 } } */
 /* { dg-options "-O -ftree-parallelize-loops=2 -fno-tree-dominator-opts --param parloops-min-per-thread=30" } */
 
 void

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-16  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-15 13:30 [PATCH] Fix PR91162 Richard Biener
2019-07-16  9:30 ` Rainer Orth

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