aboutsummaryrefslogtreecommitdiff
path: root/gcc/loop.c
diff options
context:
space:
mode:
authorMichael Hayes <mhayes@redhat.com>2001-01-05 02:51:18 +0000
committerMichael Hayes <m.hayes@gcc.gnu.org>2001-01-05 02:51:18 +0000
commit576d0b547dce3fbe4072cc41101b11faa7f47176 (patch)
tree0571be8f19ff77b52169867d25d4e02bd819ddf5 /gcc/loop.c
parent616af7ee28259c26e26846775899f38d0ae79fdf (diff)
downloadgcc-576d0b547dce3fbe4072cc41101b11faa7f47176.zip
gcc-576d0b547dce3fbe4072cc41101b11faa7f47176.tar.gz
gcc-576d0b547dce3fbe4072cc41101b11faa7f47176.tar.bz2
loop.c (prescan_loop): Set loop_info->has_nonconst_call.
* loop.c (prescan_loop): Set loop_info->has_nonconst_call. Use it instead of loop_info->has_call for scanning loop mems. (check_dbra_loop): Replace loop_info->has_call test with loop_info->has_nonconst_call. From-SVN: r38699
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index a504ed6..39e8920 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -2292,7 +2292,7 @@ count_nonfixed_reads (loop, x)
}
/* Scan a loop setting the elements `cont', `vtop', `loops_enclosed',
- `has_call', `has_volatile', `has_tablejump',
+ `has_call', `has_nonconst_call', `has_volatile', `has_tablejump',
`unknown_address_altered', `unknown_constant_address_altered', and
`num_mem_sets' in LOOP. Also, fill in the array `mems' and the
list `store_mems' in LOOP. */
@@ -2315,6 +2315,7 @@ prescan_loop (loop)
loop_info->has_indirect_jump = indirect_jump_in_function;
loop_info->pre_header_has_call = 0;
loop_info->has_call = 0;
+ loop_info->has_nonconst_call = 0;
loop_info->has_volatile = 0;
loop_info->has_tablejump = 0;
loop_info->has_multiple_exit_targets = 0;
@@ -2357,7 +2358,10 @@ prescan_loop (loop)
else if (GET_CODE (insn) == CALL_INSN)
{
if (! CONST_CALL_P (insn))
- loop_info->unknown_address_altered = 1;
+ {
+ loop_info->unknown_address_altered = 1;
+ loop_info->has_nonconst_call = 1;
+ }
loop_info->has_call = 1;
}
else if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
@@ -2424,7 +2428,7 @@ prescan_loop (loop)
/* Now, rescan the loop, setting up the LOOP_MEMS array. */
if (/* An exception thrown by a called function might land us
anywhere. */
- ! loop_info->has_call
+ ! loop_info->has_nonconst_call
/* We don't want loads for MEMs moved to a location before the
one at which their stack memory becomes allocated. (Note
that this is not a problem for malloc, etc., since those
@@ -7462,7 +7466,7 @@ check_dbra_loop (loop, insn_count)
about all these things. */
if ((num_nonfixed_reads <= 1
- && ! loop_info->has_call
+ && ! loop_info->has_nonconst_call
&& ! loop_info->has_volatile
&& reversible_mem_store
&& (bl->giv_count + bl->biv_count + loop_info->num_mem_sets