From 85f4f7fe4a0a53bfeb474772b2cbce064151fc02 Mon Sep 17 00:00:00 2001 From: "m.hayes" Date: Wed, 19 Jan 2000 20:10:00 +0000 Subject: [PATCH] * loop.c (loop_optimize): Allocate loop_info structure for each loop prior to calling scan_loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31508 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/loop.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3ccbe76..fff7083 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-01-20 Michael Hayes + + * loop.c (loop_optimize): Allocate loop_info structure for each loop + prior to calling scan_loop. + Wed Jan 19 19:54:38 2000 J"orn Rennecke * sh.c (prepare_scc_operands): Abort if no compare insn is available. diff --git a/gcc/loop.c b/gcc/loop.c index d69094f..b52b33a 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -510,15 +510,21 @@ loop_optimize (f, dumpfile, unroll_p, bct_p) this prevents low overhead loop instructions from being used. */ indirect_jump_in_function = indirect_jump_in_function_p (f); - /* Now scan the loops, last ones first, since this means inner ones are done - before outer ones. */ + /* Allocate and initialize auxiliary loop information. */ for (i = max_loop_num - 1; i >= 0; i--) { struct loop *loop = &loops->array[i]; loop->info = (struct loop_info *) alloca (sizeof (struct loop_info)); memset (loop->info, 0, sizeof (struct loop_info)); - + } + + /* Now scan the loops, last ones first, since this means inner ones are done + before outer ones. */ + for (i = max_loop_num - 1; i >= 0; i--) + { + struct loop *loop = &loops->array[i]; + if (! loop->invalid && loop->end) scan_loop (loop, unroll_p, bct_p); } -- 2.7.4