From: Jeff Law Date: Wed, 27 Nov 2013 18:47:43 +0000 (-0700) Subject: tree-ssa-threadupdate.c (thread_through_all_blocks): Do not clobber the loop structur... X-Git-Tag: releases/gcc-4.9.0~2408 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fa788bb403ace05d749fcfd753735e7d23c29760;p=thirdparty%2Fgcc.git tree-ssa-threadupdate.c (thread_through_all_blocks): Do not clobber the loop structure thread_block was unsuccessful. * tree-ssa-threadupdate.c (thread_through_all_blocks): Do not clobber the loop structure thread_block was unsuccessful. If thread_block was unsuccessful, cleanup appropriately. From-SVN: r205459 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 404d7858c9b4..ad6468e233e5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-11-27 Jeff Law + + * tree-ssa-threadupdate.c (thread_through_all_blocks): Do not + clobber the loop structure thread_block was unsuccessful. If + thread_block was unsuccessful, cleanup appropriately. + 2013-11-27 Chen Liqin * config/score/score.h (REG_CLASS_FROM_LETTER): Delete. diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index 1a52e4702fa0..24d0f42a168d 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -1676,13 +1676,20 @@ thread_through_all_blocks (bool may_peel_loop_headers) { struct loop *loop = (*path)[0]->e->dest->loop_father; - retval |= thread_block ((*path)[0]->e->dest, false); - e->aux = NULL; - - /* This jump thread likely totally scrambled this loop. - So arrange for it to be fixed up. */ - loop->header = NULL; - loop->latch = NULL; + if (thread_block ((*path)[0]->e->dest, false)) + { + /* This jump thread likely totally scrambled this loop. + So arrange for it to be fixed up. */ + loop->header = NULL; + loop->latch = NULL; + e->aux = NULL; + } + else + { + delete_jump_thread_path (path); + e->aux = NULL; + ei_next (&ei); + } } } else