aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2009-11-02 15:13:49 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2009-11-02 15:13:49 +0100
commit2b93f88dc57229e8e6d8fd6a868d3f54f8e7b43e (patch)
tree92a4ac036624eca55b4c96bfbf169439b117c524 /gcc/tree-sra.c
parent68052d59d6c867e7346e91900d287ba2d374a3b4 (diff)
downloadgcc-2b93f88dc57229e8e6d8fd6a868d3f54f8e7b43e.zip
gcc-2b93f88dc57229e8e6d8fd6a868d3f54f8e7b43e.tar.gz
gcc-2b93f88dc57229e8e6d8fd6a868d3f54f8e7b43e.tar.bz2
re PR tree-optimization/41750 (IPA-SRA is broken)
2009-11-02 Martin Jambor <mjambor@suse.cz> PR tree-optimization/41750 * tree-sra.c (analyze_modified_params): Loop over all representatives of components of a parameter. * testsuite/gcc.c-torture/execute/pr41750.c: New test. From-SVN: r153809
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 8db84ea..12b1990 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -2818,33 +2818,39 @@ analyze_modified_params (VEC (access_p, heap) *representatives)
for (i = 0; i < func_param_count; i++)
{
- struct access *repr = VEC_index (access_p, representatives, i);
- VEC (access_p, heap) *access_vec;
- int j, access_count;
- tree parm;
-
- if (!repr || no_accesses_p (repr))
- continue;
- parm = repr->base;
- if (!POINTER_TYPE_P (TREE_TYPE (parm))
- || repr->grp_maybe_modified)
- continue;
+ struct access *repr;
- access_vec = get_base_access_vector (parm);
- access_count = VEC_length (access_p, access_vec);
- for (j = 0; j < access_count; j++)
+ for (repr = VEC_index (access_p, representatives, i);
+ repr;
+ repr = repr->next_grp)
{
- struct access *access;
- ao_ref ar;
-
- /* All accesses are read ones, otherwise grp_maybe_modified would be
- trivially set. */
- access = VEC_index (access_p, access_vec, j);
- ao_ref_init (&ar, access->expr);
- walk_aliased_vdefs (&ar, gimple_vuse (access->stmt),
- mark_maybe_modified, repr, NULL);
- if (repr->grp_maybe_modified)
- break;
+ VEC (access_p, heap) *access_vec;
+ int j, access_count;
+ tree parm;
+
+ if (no_accesses_p (repr))
+ continue;
+ parm = repr->base;
+ if (!POINTER_TYPE_P (TREE_TYPE (parm))
+ || repr->grp_maybe_modified)
+ continue;
+
+ access_vec = get_base_access_vector (parm);
+ access_count = VEC_length (access_p, access_vec);
+ for (j = 0; j < access_count; j++)
+ {
+ struct access *access;
+ ao_ref ar;
+
+ /* All accesses are read ones, otherwise grp_maybe_modified would
+ be trivially set. */
+ access = VEC_index (access_p, access_vec, j);
+ ao_ref_init (&ar, access->expr);
+ walk_aliased_vdefs (&ar, gimple_vuse (access->stmt),
+ mark_maybe_modified, repr, NULL);
+ if (repr->grp_maybe_modified)
+ break;
+ }
}
}
}