aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/loop-init.c
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2016-03-16 13:56:07 -0700
committerCaroline Tice <cmtice@google.com>2016-03-16 13:56:07 -0700
commitac16f08b86701ecf70e32f4ead8db63d92603808 (patch)
tree08f5e73c8a8f3c980468347bcc0c283bc1e6d3eb /gcc-4.9/gcc/loop-init.c
parent3a800d7d75ceba88429096186a2150a2d938334a (diff)
downloadtoolchain_gcc-ac16f08b86701ecf70e32f4ead8db63d92603808.tar.gz
toolchain_gcc-ac16f08b86701ecf70e32f4ead8db63d92603808.tar.bz2
toolchain_gcc-ac16f08b86701ecf70e32f4ead8db63d92603808.zip
GCC unification, part 2. Fix various errors from previous unificaiton.
The previous version of the unified GCC compiler (Android & ChromeOS) caused some ChromeOS tests to fail. It also caused an Android NDK test case to fail. This CL fixes those problems. In particular it does the following: - Fix some file formatting errors from previous unification patch. - Update ChangeLog files to reflect Android backport patches. - Find and incorporate a few missing pieces from the following backports backports from trunk r221007, r221675, r222011, r212011, r214942, r214957, r215012, r215016, r218115, r218733, r218746, r220491. This involved small changes in the following files: gcc/cfghoks.c gcc/cfgloop.c gcc/cfgloop.h gcc/except.c gcc/loop-init.c gcc/omp-low.c - Fix minor Android test case regression introduced in the previous unification patch. Change-Id: I482e3a34e3ed97c7ba609fe2954b4781f02ec617
Diffstat (limited to 'gcc-4.9/gcc/loop-init.c')
-rw-r--r--gcc-4.9/gcc/loop-init.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/loop-init.c b/gcc-4.9/gcc/loop-init.c
index 4cc561c2e..a8abf372a 100644
--- a/gcc-4.9/gcc/loop-init.c
+++ b/gcc-4.9/gcc/loop-init.c
@@ -272,6 +272,33 @@ fix_loop_structure (bitmap changed_bbs)
FOR_EACH_VEC_ELT (*get_loops (cfun), i, loop)
if (loop && loop->header == NULL)
{
+ if (dump_file
+ && ((unsigned) loop->former_header->index
+ < basic_block_info_for_fn (cfun)->length ()))
+ {
+ basic_block former_header
+ = BASIC_BLOCK_FOR_FN (cfun, loop->former_header->index);
+ /* If the old header still exists we want to check if the
+ original loop is re-discovered or the old header is now
+ part of a newly discovered loop.
+ In both cases we should have avoided removing the loop. */
+ if (former_header == loop->former_header)
+ {
+ if (former_header->loop_father->header == former_header)
+ fprintf (dump_file, "fix_loop_structure: rediscovered "
+ "removed loop %d as loop %d with old header %d\n",
+ loop->num, former_header->loop_father->num,
+ former_header->index);
+ else if ((unsigned) former_header->loop_father->num
+ >= old_nloops)
+ fprintf (dump_file, "fix_loop_structure: header %d of "
+ "removed loop %d is part of the newly "
+ "discovered loop %d with header %d\n",
+ former_header->index, loop->num,
+ former_header->loop_father->num,
+ former_header->loop_father->header->index);
+ }
+ }
(*get_loops (cfun))[i] = NULL;
flow_loop_free (loop);
}