diff options
author | cfang <cfang@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-23 17:45:08 +0000 |
---|---|---|
committer | cfang <cfang@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-23 17:45:08 +0000 |
commit | 09a6f6f50279485f8727c768e35c18cc6a22afd4 (patch) | |
tree | 9db10ff1386e8c9e1c0147f462aacb0ee6eaab28 /gcc/tree-ssa-loop-prefetch.c | |
parent | b6414606073927bbdbbce859afd266303ae03b39 (diff) | |
download | gcc-09a6f6f50279485f8727c768e35c18cc6a22afd4.tar.gz |
pr45260 Don't generate prefetch if the address of base could not be taken.
* tree-flow.h (may_be_nonaddressable_p): New definition. Make the
existing static function global.
*tree-ssa-loop-ivopts.c (may_be_nonaddressable_p): This function
is changed to global.
*tree-ssa-loop-prefetch.c (gather_memory_references_ref): Call
may_be_nonaddressable_p on base, and don't collect this reference
if the address of the base could not be taken.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163475 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-prefetch.c')
-rw-r--r-- | gcc/tree-ssa-loop-prefetch.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c index 9ad6cd2a59e..4e7068f1859 100644 --- a/gcc/tree-ssa-loop-prefetch.c +++ b/gcc/tree-ssa-loop-prefetch.c @@ -539,6 +539,10 @@ gather_memory_references_ref (struct loop *loop, struct mem_ref_group **refs, if (step == NULL_TREE) return false; + /* Stop if the address of BASE could not taken. */ + if (may_be_nonaddressable_p (base)) + return false; + /* Limit non-constant step prefetching only to the innermost loops. */ if (!cst_and_fits_in_hwi (step) && loop->inner != NULL) return false; |