summaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-02 14:13:49 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-02 14:13:49 +0000
commitfe9e92d635d662fe1cd8d03dea9d33a7457fb3d7 (patch)
tree92a4ac036624eca55b4c96bfbf169439b117c524 /gcc/tree-sra.c
parent8b1b3308943798cf98957064d54d2d5fe2bd0ebf (diff)
downloadgcc-fe9e92d635d662fe1cd8d03dea9d33a7457fb3d7.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153809 138bc75d-0d04-0410-961f-82ee72b054a4
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 8db84ea2971..12b19909db9 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;
+ }
}
}
}