diff options
| author | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-19 11:19:20 +0000 |
|---|---|---|
| committer | m.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-01-19 11:19:20 +0000 |
| commit | 0e59a3eefceef6c47934400bb383506f7524dd06 (patch) | |
| tree | fdb434cc0eb7f99ced77dc81bd95efde671d920d | |
| parent | c5aaf45f53d93931fec068df657565d321019c82 (diff) | |
| download | ppe42-gcc-0e59a3eefceef6c47934400bb383506f7524dd06.tar.gz ppe42-gcc-0e59a3eefceef6c47934400bb383506f7524dd06.zip | |
* loop.c (current_loop_info): Renamed from loop_info_data
and changed to a pointer.
(loop_optimize): Allocate loop_info structure for each loop
and initialise to zero.
(scan_loop): Set current_loop_info.
* unroll.c (loop_iterations): Don't abort if REG_USERVAR_P set
on iteration_var.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31501 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/loop.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/loop.c b/gcc/loop.c index b02e4b0dc99..d69094f5db8 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -53,10 +53,10 @@ Boston, MA 02111-1307, USA. */ #include "except.h" #include "toplev.h" -/* Information about the loop being processed used to compute +/* Information about the current loop being processed used to compute the number of loop iterations for loop unrolling and doloop optimization. */ -static struct loop_info loop_info_data; +static struct loop_info *current_loop_info; /* Vector mapping INSN_UIDs to luids. The luids are like uids but increase monotonically always. @@ -516,6 +516,9 @@ loop_optimize (f, dumpfile, unroll_p, bct_p) { struct loop *loop = &loops->array[i]; + loop->info = (struct loop_info *) alloca (sizeof (struct loop_info)); + memset (loop->info, 0, sizeof (struct loop_info)); + if (! loop->invalid && loop->end) scan_loop (loop, unroll_p, bct_p); } @@ -578,6 +581,7 @@ scan_loop (loop, unroll_p, bct_p) register int i; rtx loop_start = loop->start; rtx loop_end = loop->end; + struct loop_info *loop_info = loop->info; rtx p; /* 1 if we are scanning insns that could be executed zero times. */ int maybe_never = 0; @@ -605,9 +609,8 @@ scan_loop (loop, unroll_p, bct_p) /* Nonzero if we are scanning instructions in a sub-loop. */ int loop_depth = 0; int nregs; - struct loop_info *loop_info = &loop_info_data; - loop->info = loop_info; + current_loop_info = loop_info; loop->top = 0; /* Determine whether this loop starts with a jump down to a test at @@ -3230,7 +3233,7 @@ invariant_p (x) && ! current_function_has_nonlocal_goto) return 1; - if (loop_info_data.has_call + if (current_loop_info->has_call && REGNO (x) < FIRST_PSEUDO_REGISTER && call_used_regs[REGNO (x)]) return 0; |

