Re: [PATCH] PR78879

2016-12-22 Thread Yuan, Pengfei
> How specifically does this fix the problem.  I suspect you're just 
> papering over the bug by changing the order of thread processing.
> 
> You'll note that when a thread is canceled we call the 
> paths.unordered_remove without incrementing i.  AFAICT you're just 
> changing order in which paths out of the array.
> 
> 
> Jeff

Please check my explanation in
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78879#c11

Thanks!

Yuan, Pengfei


Re: [PATCH] PR78879

2016-12-22 Thread Jeff Law

On 12/21/2016 11:08 PM, Yuan, Pengfei wrote:

Hi,

The following patch fixes
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78879

There are some other invocations of unordered_remove in
tree-ssa-threadupdate.c, which may also need to be replaced
with ordered_remove.

Regards,
Yuan, Pengfei


2016-12-22  Yuan Pengfei  

PR middle-end/78879
* tree-ssa-threadupdate.c (mark_threaded_blocks): Replace
unordered_remove with ordered_remove.
How specifically does this fix the problem.  I suspect you're just 
papering over the bug by changing the order of thread processing.


You'll note that when a thread is canceled we call the 
paths.unordered_remove without incrementing i.  AFAICT you're just 
changing order in which paths out of the array.



Jeff



[PATCH] PR78879

2016-12-21 Thread Yuan, Pengfei
Hi,

The following patch fixes
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78879

There are some other invocations of unordered_remove in
tree-ssa-threadupdate.c, which may also need to be replaced
with ordered_remove.

Regards,
Yuan, Pengfei


2016-12-22  Yuan Pengfei  

PR middle-end/78879
* tree-ssa-threadupdate.c (mark_threaded_blocks): Replace
unordered_remove with ordered_remove.


diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 5a5f8df..b2e6d7a 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -2144,7 +2144,7 @@ mark_threaded_blocks (bitmap threaded_blocks)
}
  else
{
- paths.unordered_remove (i);
+ paths.ordered_remove (i);
  if (dump_file && (dump_flags & TDF_DETAILS))
dump_jump_thread_path (dump_file, *path, false);
  delete_jump_thread_path (path);
@@ -2180,7 +2180,7 @@ mark_threaded_blocks (bitmap threaded_blocks)
  else
{
  e->aux = NULL;
- paths.unordered_remove (i);
+ paths.ordered_remove (i);
  if (dump_file && (dump_flags & TDF_DETAILS))
dump_jump_thread_path (dump_file, *path, false);
  delete_jump_thread_path (path);