Hi.

As mentioned in the PR, gimple nops are wrongly handled in is_maybe_undefined 
function.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin
>From 54b98e2d035f92ec20bf7b548f90b1d00c4c597b Mon Sep 17 00:00:00 2001
From: marxin <mli...@suse.cz>
Date: Wed, 15 Feb 2017 13:46:38 +0100
Subject: [PATCH] Handle GIMPLE NOPs in is_maybe_undefined (PR
 tree-optimization/79529).

gcc/ChangeLog:

2017-02-15  Martin Liska  <mli...@suse.cz>

	PR tree-optimization/79529
	* tree-ssa-loop-unswitch.c (is_maybe_undefined): Bail out when
	spotting a gimple NOP.
---
 gcc/tree-ssa-loop-unswitch.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index 4ef3a6bf80a..a52e4719bec 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -141,6 +141,9 @@ is_maybe_undefined (const tree name, gimple *stmt, struct loop *loop)
 
       gimple *def = SSA_NAME_DEF_STMT (t);
 
+      if (!def || gimple_nop_p (def))
+	return true;
+
       /* Check that all the PHI args are fully defined.  */
       if (gphi *phi = dyn_cast <gphi *> (def))
 	{
-- 
2.11.0

Reply via email to