public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR90131, wrong-debug
@ 2019-04-18 10:21 Richard Biener
  2019-04-19  9:28 ` Jakub Jelinek
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2019-04-18 10:21 UTC (permalink / raw)
  To: gcc-patches


This fixes another case similar to the fixed PR89892, mergephi
via remove_forwarder_block_with_phi caused out-of-date debug
binds to become live and thus needs similar treatment as
remove_forwarder_block.  Previously it didn't even bother
to move debug stmts because the destination always has
multiple predecessors.  Now we have to move and reset them.

Fixed by factoring out a worker from remove_forwarder_block and
using that from remove_forwarder_block_with_phi as well.

Bootstrap & regtest running on x86_64-unknown-linux-gnu.

Richard.

2019-04-18  Richard Biener  <rguenther@suse.de>

	PR debug/90131
	* tree-cfgcleanup.c (move_debug_stmts_from_forwarder): Split
	out from ...
	(remove_forwarder_block): ... here.
	(remove_forwarder_block_with_phi): Also move debug stmts here.

	* gcc.dg/guality/pr90131.c: New testcase.

Index: gcc/tree-cfgcleanup.c
===================================================================
--- gcc/tree-cfgcleanup.c	(revision 270437)
+++ gcc/tree-cfgcleanup.c	(working copy)
@@ -444,6 +444,45 @@ phi_alternatives_equal (basic_block dest
   return true;
 }
 
+/* Move debug stmts from the forwarder block SRC to DEST.  */
+
+static void
+move_debug_stmts_from_forwarder (basic_block src, basic_block dest)
+{
+  if (!MAY_HAVE_DEBUG_STMTS)
+    return;
+
+  bool can_move_debug_stmts = single_pred_p (dest);
+  gimple_stmt_iterator gsi_to = gsi_after_labels (dest);
+  for (gimple_stmt_iterator gsi = gsi_after_labels (src); !gsi_end_p (gsi);)
+    {
+      gimple *debug = gsi_stmt (gsi);
+      gcc_assert (is_gimple_debug (debug));
+      /* Move debug binds anyway, but not anything else like begin-stmt
+	 markers unless they are always valid at the destination.  */
+      if (can_move_debug_stmts
+	  || gimple_debug_bind_p (debug))
+	{
+	  gsi_move_before (&gsi, &gsi_to);
+	  /* Reset debug-binds that are not always valid at the destination.
+	     Simply dropping them can cause earlier values to become live,
+	     generating wrong debug information.
+	     ???  There are several things we could improve here.  For
+	     one we might be able to move stmts to the predecessor.
+	     For anther, if the debug stmt is immediately followed by a
+	     (debug) definition in the destination (on a post-dominated path?)
+	     we can elide it without any bad effects.  */
+	  if (!can_move_debug_stmts)
+	    {
+	      gimple_debug_bind_reset_value (debug);
+	      update_stmt (debug);
+	    }
+	}
+      else
+	gsi_next (&gsi);
+    }
+}
+
 /* Removes forwarder block BB.  Returns false if this failed.  */
 
 static bool
@@ -454,7 +493,6 @@ remove_forwarder_block (basic_block bb)
   gimple *stmt;
   edge_iterator ei;
   gimple_stmt_iterator gsi, gsi_to;
-  bool can_move_debug_stmts;
 
   /* We check for infinite loops already in tree_forwarder_block_p.
      However it may happen that the infinite loop is created
@@ -503,8 +541,6 @@ remove_forwarder_block (basic_block bb)
 	}
     }
 
-  can_move_debug_stmts = MAY_HAVE_DEBUG_STMTS && single_pred_p (dest);
-
   basic_block pred = NULL;
   if (single_pred_p (bb))
     pred = single_pred (bb);
@@ -566,40 +602,7 @@ remove_forwarder_block (basic_block bb)
 
   /* Move debug statements.  Reset them if the destination does not
      have a single predecessor.  */
-  if (!gsi_end_p (gsi))
-    {
-      gsi_to = gsi_after_labels (dest);
-      do
-	{
-	  gimple *debug = gsi_stmt (gsi);
-	  gcc_assert (is_gimple_debug (debug));
-	  /* Move debug binds anyway, but not anything else
-	     like begin-stmt markers unless they are always
-	     valid at the destination.  */
-	  if (can_move_debug_stmts
-	      || gimple_debug_bind_p (debug))
-	    {
-	      gsi_move_before (&gsi, &gsi_to);
-	      /* Reset debug-binds that are not always valid at the
-		 destination.  Simply dropping them can cause earlier
-		 values to become live, generating wrong debug information.
-		 ???  There are several things we could improve here.  For
-		 one we might be able to move stmts to the predecessor.
-		 For anther, if the debug stmt is immediately followed
-		 by a (debug) definition in the destination (on a
-		 post-dominated path?) we can elide it without any bad
-		 effects.  */
-	      if (!can_move_debug_stmts)
-		{
-		  gimple_debug_bind_reset_value (debug);
-		  update_stmt (debug);
-		}
-	    }
-	  else
-	    gsi_next (&gsi);
-	}
-      while (!gsi_end_p (gsi));
-    }
+  move_debug_stmts_from_forwarder (bb, dest);
 
   bitmap_set_bit (cfgcleanup_altered_bbs, dest->index);
 
@@ -1282,6 +1285,10 @@ remove_forwarder_block_with_phi (basic_b
       redirect_edge_var_map_clear (e);
     }
 
+  /* Move debug statements.  Reset them if the destination does not
+     have a single predecessor.  */
+  move_debug_stmts_from_forwarder (bb, dest);
+
   /* Update the dominators.  */
   dombb = get_immediate_dominator (CDI_DOMINATORS, bb);
   domdest = get_immediate_dominator (CDI_DOMINATORS, dest);
Index: gcc/testsuite/gcc.dg/guality/pr90131.c
===================================================================
--- gcc/testsuite/gcc.dg/guality/pr90131.c	(nonexistent)
+++ gcc/testsuite/gcc.dg/guality/pr90131.c	(working copy)
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+void __attribute__((noinline))
+optimize_me_not ()
+{
+  __asm__ volatile ("" : : : "memory");
+}
+volatile long a;
+int b[9][1];
+static short c[2][1] = {3};
+int main()
+{
+  int i, d, e;
+  i = 0;
+  for (; i < 9; i++)
+    a = b[i][0];
+  i = 0;
+  for (; i < 2; i++)
+    {
+      d = 0;
+      for (; d < 1; d++)
+	{
+	  e = 0;
+	  for (; e < 1; e++)
+	    a = c[i][e];
+	  /* i may very well be optimized out, so we cannot test for i == 0.
+	     Instead test i + 1 which will make the test UNSUPPORTED if i
+	     is optimized out.  Since the test previously had wrong debug
+	     with i == 9 this is acceptable.  */
+	  optimize_me_not(); /* { dg-final { gdb-test . "i + 1" "1" } } */
+	}
+    }
+  return 0;
+}

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

* Re: [PATCH] Fix PR90131, wrong-debug
  2019-04-18 10:21 [PATCH] Fix PR90131, wrong-debug Richard Biener
@ 2019-04-19  9:28 ` Jakub Jelinek
  2019-04-19 14:20   ` Jeff Law
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Jelinek @ 2019-04-19  9:28 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

On Thu, Apr 18, 2019 at 11:20:32AM +0200, Richard Biener wrote:
> 
> This fixes another case similar to the fixed PR89892, mergephi
> via remove_forwarder_block_with_phi caused out-of-date debug
> binds to become live and thus needs similar treatment as
> remove_forwarder_block.  Previously it didn't even bother
> to move debug stmts because the destination always has
> multiple predecessors.  Now we have to move and reset them.
> 
> Fixed by factoring out a worker from remove_forwarder_block and
> using that from remove_forwarder_block_with_phi as well.
> 
> Bootstrap & regtest running on x86_64-unknown-linux-gnu.

This regressed quite a few guality tests on both x86_64 and i686:
+FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 x == 36
+FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 y == 25
+FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 6
+FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 x == 98
+FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 y == 117
+FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 z == 8
+FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
+FAIL: gcc.dg/guality/pr54519-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 x == 6
+FAIL: gcc.dg/guality/pr54519-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 y == 25
+FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 x == 36
+FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 y == 25
+FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 6
+FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 x == 98
+FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 y == 117
+FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 z == 8
+FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  -DPREVENT_OPTIMIZATION line 20 x == 36
+FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  -DPREVENT_OPTIMIZATION line 23 x == 98
+FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 x == 36
+FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 x == 98
+FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 x == 36
+FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 y == 25
+FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 6
+FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 x == 98
+FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 y == 117
+FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 z == 8
+FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 x == 36
+FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 y == 25
+FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 z == 6
+FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 x == 98
+FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 y == 117
+FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 z == 8
+FAIL: gcc.dg/guality/pr54519-4.c   -O2  -DPREVENT_OPTIMIZATION  line 17 x == 6
+FAIL: gcc.dg/guality/pr54519-4.c   -O2  -DPREVENT_OPTIMIZATION  line 17 y == 25
+FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  -DPREVENT_OPTIMIZATION line 17 x == 6
+FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
+FAIL: gcc.dg/guality/pr54519-4.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 x == 6
+FAIL: gcc.dg/guality/pr54519-4.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 y == 25
+FAIL: gcc.dg/guality/pr54519-4.c   -Os  -DPREVENT_OPTIMIZATION  line 17 x == 6
+FAIL: gcc.dg/guality/pr54519-4.c   -Os  -DPREVENT_OPTIMIZATION  line 17 y == 25
+FAIL: gcc.dg/guality/pr54519-5.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
+FAIL: gcc.dg/guality/pr54519-5.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 x == 6
+FAIL: gcc.dg/guality/pr54519-5.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 y == 25
+FAIL: gcc.dg/guality/pr54519-6.c   -Os  -DPREVENT_OPTIMIZATION  line 11 x == 2
+FAIL: gcc.dg/guality/pr54519-6.c   -Os  -DPREVENT_OPTIMIZATION  line 11 y == 0
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg1 == 1
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg2 == 2
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg3 == 3
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg4 == 4
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg5 == 5
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg6 == 6
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg1 == 1
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg2 == 2
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg3 == 3
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg4 == 4
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg5 == 5
+FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg6 == 6
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg1 == 1
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg2 == 2
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg3 == 3
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg4 == 4
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg5 == 5
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg6 == 6
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg1 == 1
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg2 == 2
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg3 == 3
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg4 == 4
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg5 == 5
+FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg6 == 6
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg1 == 1
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg2 == 2
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg3 == 3
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg4 == 4
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg5 == 5
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg6 == 6
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg1 == 1
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg2 == 2
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg3 == 3
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg4 == 4
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg5 == 5
+FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg6 == 6

	Jakub

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

* Re: [PATCH] Fix PR90131, wrong-debug
  2019-04-19  9:28 ` Jakub Jelinek
@ 2019-04-19 14:20   ` Jeff Law
  2019-04-21 16:03     ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Law @ 2019-04-19 14:20 UTC (permalink / raw)
  To: Jakub Jelinek, Richard Biener; +Cc: gcc-patches

On 4/19/19 3:26 AM, Jakub Jelinek wrote:
> On Thu, Apr 18, 2019 at 11:20:32AM +0200, Richard Biener wrote:
>>
>> This fixes another case similar to the fixed PR89892, mergephi
>> via remove_forwarder_block_with_phi caused out-of-date debug
>> binds to become live and thus needs similar treatment as
>> remove_forwarder_block.  Previously it didn't even bother
>> to move debug stmts because the destination always has
>> multiple predecessors.  Now we have to move and reset them.
>>
>> Fixed by factoring out a worker from remove_forwarder_block and
>> using that from remove_forwarder_block_with_phi as well.
>>
>> Bootstrap & regtest running on x86_64-unknown-linux-gnu.
> 
> This regressed quite a few guality tests on both x86_64 and i686:
> +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 x == 36
> +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 y == 25
> +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 6
> +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 x == 98
> +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 y == 117
> +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 z == 8
> +FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
> +FAIL: gcc.dg/guality/pr54519-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 x == 6
> +FAIL: gcc.dg/guality/pr54519-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 y == 25
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 x == 36
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 y == 25
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 6
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 x == 98
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 y == 117
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 z == 8
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  -DPREVENT_OPTIMIZATION line 20 x == 36
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  -DPREVENT_OPTIMIZATION line 23 x == 98
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 x == 36
> +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 x == 98
> +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 x == 36
> +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 y == 25
> +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 6
> +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 x == 98
> +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 y == 117
> +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 z == 8
> +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 x == 36
> +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 y == 25
> +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 z == 6
> +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 x == 98
> +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 y == 117
> +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 z == 8
> +FAIL: gcc.dg/guality/pr54519-4.c   -O2  -DPREVENT_OPTIMIZATION  line 17 x == 6
> +FAIL: gcc.dg/guality/pr54519-4.c   -O2  -DPREVENT_OPTIMIZATION  line 17 y == 25
> +FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  -DPREVENT_OPTIMIZATION line 17 x == 6
> +FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
> +FAIL: gcc.dg/guality/pr54519-4.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 x == 6
> +FAIL: gcc.dg/guality/pr54519-4.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 y == 25
> +FAIL: gcc.dg/guality/pr54519-4.c   -Os  -DPREVENT_OPTIMIZATION  line 17 x == 6
> +FAIL: gcc.dg/guality/pr54519-4.c   -Os  -DPREVENT_OPTIMIZATION  line 17 y == 25
> +FAIL: gcc.dg/guality/pr54519-5.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
> +FAIL: gcc.dg/guality/pr54519-5.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 x == 6
> +FAIL: gcc.dg/guality/pr54519-5.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 y == 25
> +FAIL: gcc.dg/guality/pr54519-6.c   -Os  -DPREVENT_OPTIMIZATION  line 11 x == 2
> +FAIL: gcc.dg/guality/pr54519-6.c   -Os  -DPREVENT_OPTIMIZATION  line 11 y == 0
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg1 == 1
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg2 == 2
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg3 == 3
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg4 == 4
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg5 == 5
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg6 == 6
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg1 == 1
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg2 == 2
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg3 == 3
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg4 == 4
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg5 == 5
> +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg6 == 6
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg1 == 1
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg2 == 2
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg3 == 3
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg4 == 4
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg5 == 5
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg6 == 6
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg1 == 1
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg2 == 2
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg3 == 3
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg4 == 4
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg5 == 5
> +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg6 == 6
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg1 == 1
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg2 == 2
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg3 == 3
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg4 == 4
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg5 == 5
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg6 == 6
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg1 == 1
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg2 == 2
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg3 == 3
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg4 == 4
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg5 == 5
> +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg6 == 6
I'm seeing similar results across x86_64, i686, aarch64, ppcle, etc.
Essentially any native target that's built over the last 24hrs has
started regressing guality tests.

Jeff

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

* Re: [PATCH] Fix PR90131, wrong-debug
  2019-04-19 14:20   ` Jeff Law
@ 2019-04-21 16:03     ` Richard Biener
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2019-04-21 16:03 UTC (permalink / raw)
  To: Jeff Law; +Cc: Jakub Jelinek, gcc-patches

On Fri, 19 Apr 2019, Jeff Law wrote:

> On 4/19/19 3:26 AM, Jakub Jelinek wrote:
> > On Thu, Apr 18, 2019 at 11:20:32AM +0200, Richard Biener wrote:
> >>
> >> This fixes another case similar to the fixed PR89892, mergephi
> >> via remove_forwarder_block_with_phi caused out-of-date debug
> >> binds to become live and thus needs similar treatment as
> >> remove_forwarder_block.  Previously it didn't even bother
> >> to move debug stmts because the destination always has
> >> multiple predecessors.  Now we have to move and reset them.
> >>
> >> Fixed by factoring out a worker from remove_forwarder_block and
> >> using that from remove_forwarder_block_with_phi as well.
> >>
> >> Bootstrap & regtest running on x86_64-unknown-linux-gnu.
> > 
> > This regressed quite a few guality tests on both x86_64 and i686:
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 x == 36
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 y == 25
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 6
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 x == 98
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 y == 117
> > +FAIL: gcc.dg/guality/pr54519-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 z == 8
> > +FAIL: gcc.dg/guality/pr54519-2.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-2.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 y == 25
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 x == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 y == 25
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 20 z == 6
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 x == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 y == 117
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2  -DPREVENT_OPTIMIZATION  line 23 z == 8
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  -DPREVENT_OPTIMIZATION line 20 x == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  -DPREVENT_OPTIMIZATION line 23 x == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 20 x == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 23 x == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 x == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 y == 25
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 20 z == 6
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 x == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 y == 117
> > +FAIL: gcc.dg/guality/pr54519-3.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 23 z == 8
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 x == 36
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 y == 25
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 20 z == 6
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 x == 98
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 y == 117
> > +FAIL: gcc.dg/guality/pr54519-3.c   -Os  -DPREVENT_OPTIMIZATION  line 23 z == 8
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O2  -DPREVENT_OPTIMIZATION  line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O2  -DPREVENT_OPTIMIZATION  line 17 y == 25
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fno-use-linker-plugin -flto-partition=none  -DPREVENT_OPTIMIZATION line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 y == 25
> > +FAIL: gcc.dg/guality/pr54519-4.c   -Os  -DPREVENT_OPTIMIZATION  line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-4.c   -Os  -DPREVENT_OPTIMIZATION  line 17 y == 25
> > +FAIL: gcc.dg/guality/pr54519-5.c   -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects  -DPREVENT_OPTIMIZATION line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-5.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 x == 6
> > +FAIL: gcc.dg/guality/pr54519-5.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 17 y == 25
> > +FAIL: gcc.dg/guality/pr54519-6.c   -Os  -DPREVENT_OPTIMIZATION  line 11 x == 2
> > +FAIL: gcc.dg/guality/pr54519-6.c   -Os  -DPREVENT_OPTIMIZATION  line 11 y == 0
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg1 == 1
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg2 == 2
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg3 == 3
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg4 == 4
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg5 == 5
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 14 arg6 == 6
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg1 == 1
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg2 == 2
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg3 == 3
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg4 == 4
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg5 == 5
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O2  -DPREVENT_OPTIMIZATION  line 16 arg6 == 6
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg1 == 1
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg2 == 2
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg3 == 3
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg4 == 4
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg5 == 5
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 14 arg6 == 6
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg1 == 1
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg2 == 2
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg3 == 3
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg4 == 4
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg5 == 5
> > +FAIL: gcc.dg/guality/pr68860-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  line 16 arg6 == 6
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg1 == 1
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg2 == 2
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg3 == 3
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg4 == 4
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg5 == 5
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 14 arg6 == 6
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg1 == 1
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg2 == 2
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg3 == 3
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg4 == 4
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg5 == 5
> > +FAIL: gcc.dg/guality/pr68860-1.c   -Os  -DPREVENT_OPTIMIZATION  line 16 arg6 == 6
> I'm seeing similar results across x86_64, i686, aarch64, ppcle, etc.
> Essentially any native target that's built over the last 24hrs has
> started regressing guality tests.

Not sure how this escaped my testing.  The following fixes it.

Boostrap/regtest running on x86_64-unknown-linux-gnu.

Richard.

2019-04-21  Richard Biener  <rguenther@suse.de>

	PR debug/90131
	* tree-cfgcleanup.c (move_debug_stmts_from_forwarder): Add
	dest_single_pred_p argument.
	(remove_forwarder_block): Adjust.
	(remove_forwarder_block_with_phi): Likewise.

Index: gcc/tree-cfgcleanup.c
===================================================================
--- gcc/tree-cfgcleanup.c	(revision 270483)
+++ gcc/tree-cfgcleanup.c	(working copy)
@@ -447,12 +447,12 @@ phi_alternatives_equal (basic_block dest
 /* Move debug stmts from the forwarder block SRC to DEST.  */
 
 static void
-move_debug_stmts_from_forwarder (basic_block src, basic_block dest)
+move_debug_stmts_from_forwarder (basic_block src, basic_block dest,
+				 bool dest_single_pred_p)
 {
   if (!MAY_HAVE_DEBUG_STMTS)
     return;
 
-  bool can_move_debug_stmts = single_pred_p (dest);
   gimple_stmt_iterator gsi_to = gsi_after_labels (dest);
   for (gimple_stmt_iterator gsi = gsi_after_labels (src); !gsi_end_p (gsi);)
     {
@@ -460,7 +460,7 @@ move_debug_stmts_from_forwarder (basic_b
       gcc_assert (is_gimple_debug (debug));
       /* Move debug binds anyway, but not anything else like begin-stmt
 	 markers unless they are always valid at the destination.  */
-      if (can_move_debug_stmts
+      if (dest_single_pred_p
 	  || gimple_debug_bind_p (debug))
 	{
 	  gsi_move_before (&gsi, &gsi_to);
@@ -472,7 +472,7 @@ move_debug_stmts_from_forwarder (basic_b
 	     For anther, if the debug stmt is immediately followed by a
 	     (debug) definition in the destination (on a post-dominated path?)
 	     we can elide it without any bad effects.  */
-	  if (!can_move_debug_stmts)
+	  if (!dest_single_pred_p)
 	    {
 	      gimple_debug_bind_reset_value (debug);
 	      update_stmt (debug);
@@ -544,6 +544,7 @@ remove_forwarder_block (basic_block bb)
   basic_block pred = NULL;
   if (single_pred_p (bb))
     pred = single_pred (bb);
+  bool dest_single_pred_p = single_pred_p (dest);
 
   /* Redirect the edges.  */
   for (ei = ei_start (bb->preds); (e = ei_safe_edge (ei)); )
@@ -602,7 +603,7 @@ remove_forwarder_block (basic_block bb)
 
   /* Move debug statements.  Reset them if the destination does not
      have a single predecessor.  */
-  move_debug_stmts_from_forwarder (bb, dest);
+  move_debug_stmts_from_forwarder (bb, dest, dest_single_pred_p);
 
   bitmap_set_bit (cfgcleanup_altered_bbs, dest->index);
 
@@ -1203,6 +1204,7 @@ remove_forwarder_block_with_phi (basic_b
   basic_block pred = NULL;
   if (single_pred_p (bb))
     pred = single_pred (bb);
+  bool dest_single_pred_p = single_pred_p (dest);
 
   /* Redirect each incoming edge to BB to DEST.  */
   while (EDGE_COUNT (bb->preds) > 0)
@@ -1287,7 +1289,7 @@ remove_forwarder_block_with_phi (basic_b
 
   /* Move debug statements.  Reset them if the destination does not
      have a single predecessor.  */
-  move_debug_stmts_from_forwarder (bb, dest);
+  move_debug_stmts_from_forwarder (bb, dest, dest_single_pred_p);
 
   /* Update the dominators.  */
   dombb = get_immediate_dominator (CDI_DOMINATORS, bb);

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

end of thread, other threads:[~2019-04-21 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-18 10:21 [PATCH] Fix PR90131, wrong-debug Richard Biener
2019-04-19  9:28 ` Jakub Jelinek
2019-04-19 14:20   ` Jeff Law
2019-04-21 16:03     ` Richard Biener

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