diff options
author | Michael Hayes <m.hayes@elec.canterbury.ac.nz> | 2000-01-19 20:10:00 +0000 |
---|---|---|
committer | Michael Hayes <m.hayes@gcc.gnu.org> | 2000-01-19 20:10:00 +0000 |
commit | 78458962965e06a91c20511ab02f88195d3b6a91 (patch) | |
tree | d045be13d28bd70795112d00036097cd78a4960b /gcc/loop.c | |
parent | eda44c7832aab6417df69d6ab57f422f63c2dd0a (diff) | |
download | gcc-78458962965e06a91c20511ab02f88195d3b6a91.zip gcc-78458962965e06a91c20511ab02f88195d3b6a91.tar.gz gcc-78458962965e06a91c20511ab02f88195d3b6a91.tar.bz2 |
loop.c (loop_optimize): Allocate loop_info structure for each loop prior to calling scan_loop.
* loop.c (loop_optimize): Allocate loop_info structure for each loop
prior to calling scan_loop.
From-SVN: r31508
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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); } |