aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2012-11-08 17:41:06 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2012-11-08 17:41:06 +0100
commit774b8a558c2fbfe0b472c814d582c8540102a17c (patch)
tree7195db6d3d4f5d2e3d8fd6f1bd369c4a1cda222d
parentd476655d1d50448593b4099d0d6e7a4124ab6984 (diff)
downloadgcc-774b8a558c2fbfe0b472c814d582c8540102a17c.zip
gcc-774b8a558c2fbfe0b472c814d582c8540102a17c.tar.gz
gcc-774b8a558c2fbfe0b472c814d582c8540102a17c.tar.bz2
ipa-prop.c (determine_known_aggregate_parts): Skip writes to different declarations when tracking writes to a declaration.
2012-11-08 Martin Jambor <mjambor@suse.cz> * ipa-prop.c (determine_known_aggregate_parts): Skip writes to different declarations when tracking writes to a declaration. * gfortran.dg/ipcp-array-1.f90: New test. From-SVN: r193330
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/ipa-prop.c7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gfortran.dg/ipcp-array-1.f9019
4 files changed, 34 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9f9e874..2e98e11 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-08 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-prop.c (determine_known_aggregate_parts): Skip writes to
+ different declarations when tracking writes to a declaration.
+
2012-11-07 David S. Miller <davem@davemloft.net>
* config/sparc/constraints.md ("U"): Document, in detail,
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index f7323a6..b78dc65 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -1318,7 +1318,12 @@ determine_known_aggregate_parts (gimple call, tree arg,
break;
}
else if (lhs_base != arg_base)
- break;
+ {
+ if (DECL_P (lhs_base))
+ continue;
+ else
+ break;
+ }
if (lhs_offset + lhs_size < arg_offset
|| lhs_offset >= (arg_offset + arg_size))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 67ee1ec..e545ea7 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2012-11-08 Martin Jambor <mjambor@suse.cz>
+
+ * gfortran.dg/ipcp-array-1.f90: New test.
+
2012-11-08 Florian Weimer <fweimer@redhat.com>
* g++.old-deja/g++.abi/cxa_vec.C: Fix typo in comment.
diff --git a/gcc/testsuite/gfortran.dg/ipcp-array-1.f90 b/gcc/testsuite/gfortran.dg/ipcp-array-1.f90
new file mode 100644
index 0000000..e39109c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/ipcp-array-1.f90
@@ -0,0 +1,19 @@
+! { dg-do compile }
+! { dg-options "-O2 -fdump-ipa-cp-details -fno-inline -fdump-tree-optimized" }
+
+subroutine bar (a, b, n)
+ integer :: a(n), b(n)
+ call foo (a, b)
+contains
+subroutine foo (a, b)
+ integer :: a(:), b(:)
+ a = b
+end subroutine
+end
+
+! { dg-final { scan-ipa-dump "Creating a specialized node of foo" "cp" } }
+! { dg-final { scan-ipa-dump-times "Aggregate replacements\[^=\]*=\[^=\]*=\[^=\]*=\[^=\]*=\[^=\]*=\[^=\]*=\[^=\]*=\[^=\]*=" 2 "cp" } }
+! { dg-final { cleanup-ipa-dump "cp" } }
+! { dg-final { scan-tree-dump-not "stride;" "optimized" } }
+! { dg-final { scan-tree-dump-not "lbound;" "optimized" } }
+! { dg-final { cleanup-tree-dump "optimized" } }