summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-21 15:44:24 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-21 15:44:24 +0000
commit0e948838fb53991de9810171eaa1e694d34541b3 (patch)
tree089ba7f69a80a87de2c6af2da38f788d0971f77f /gcc
parente8fe2029241159f9b55ef3117ace84dfc676aace (diff)
downloadgcc-0e948838fb53991de9810171eaa1e694d34541b3.tar.gz
Fix PR 44955: Strip off the real and complex parts.
2010-07-21 Changpeng Fang <changpeng.fang@amd.com> PR tree-optimization/44955 * tree-ssa-loop-prefetch.c (analyze_ref): Strip off the real and imagine parts of a complex, so that they can have the same base and fall into the same group. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162381 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-ssa-loop-prefetch.c16
2 files changed, 18 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e4dbeb6a75a..9bca90e4734 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-07-21 Changpeng Fang <changpeng.fang@amd.com>
+
+ * tree-ssa-loop-prefetch.c (analyze_ref): Strip off the real
+ and imagine parts of a complex, so that they can have the same
+ base and fall into the same group.
+
2010-07-21 Richard Guenther <rguenther@suse.de>
PR lto/45018
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 1932d05c366..4840704be19 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -486,10 +486,18 @@ analyze_ref (struct loop *loop, tree *ref_p, tree *base,
*step = NULL_TREE;
*delta = 0;
- /* First strip off the component references. Ignore bitfields. */
- if (TREE_CODE (ref) == COMPONENT_REF
- && DECL_NONADDRESSABLE_P (TREE_OPERAND (ref, 1)))
- ref = TREE_OPERAND (ref, 0);
+ /* First strip off the component references. Ignore bitfields.
+ Also strip off the real and imagine parts of a complex, so that
+ they can have the same base. */
+ if (TREE_CODE (ref) == REALPART_EXPR
+ || TREE_CODE (ref) == IMAGPART_EXPR
+ || (TREE_CODE (ref) == COMPONENT_REF
+ && DECL_NONADDRESSABLE_P (TREE_OPERAND (ref, 1))))
+ {
+ if (TREE_CODE (ref) == IMAGPART_EXPR)
+ *delta += int_size_in_bytes (TREE_TYPE (ref));
+ ref = TREE_OPERAND (ref, 0);
+ }
*ref_p = ref;