Commit 2b93f88d by Martin Jambor Committed by Martin Jambor

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
parent 68052d59
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.
2009-11-02 Jakub Jelinek <jakub@redhat.com> 2009-11-02 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/41841 PR tree-optimization/41841
2009-11-02 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/41750
* gcc.c-torture/execute/pr41750.c: New test.
2009-11-02 Jakub Jelinek <jakub@redhat.com> 2009-11-02 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/41841 PR tree-optimization/41841
......
/* PR 41750 - IPA-SRA used to pass hash->sgot by value rather than by
reference. */
struct bfd_link_hash_table
{
int hash;
};
struct foo_link_hash_table
{
struct bfd_link_hash_table root;
int *dynobj;
int *sgot;
};
struct foo_link_info
{
struct foo_link_hash_table *hash;
};
extern void abort (void);
int __attribute__((noinline))
foo_create_got_section (int *abfd, struct foo_link_info *info)
{
info->hash->sgot = abfd;
return 1;
}
static int *
get_got (int *abfd, struct foo_link_info *info,
struct foo_link_hash_table *hash)
{
int *got;
int *dynobj;
got = hash->sgot;
if (!got)
{
dynobj = hash->dynobj;
if (!dynobj)
hash->dynobj = dynobj = abfd;
if (!foo_create_got_section (dynobj, info))
return 0;
got = hash->sgot;
}
return got;
}
int * __attribute__((noinline,noclone))
elf64_ia64_check_relocs (int *abfd, struct foo_link_info *info)
{
return get_got (abfd, info, info->hash);
}
struct foo_link_info link_info;
struct foo_link_hash_table hash;
int abfd;
int
main ()
{
link_info.hash = &hash;
if (elf64_ia64_check_relocs (&abfd, &link_info) != &abfd)
abort ();
return 0;
}
...@@ -2818,12 +2818,17 @@ analyze_modified_params (VEC (access_p, heap) *representatives) ...@@ -2818,12 +2818,17 @@ analyze_modified_params (VEC (access_p, heap) *representatives)
for (i = 0; i < func_param_count; i++) for (i = 0; i < func_param_count; i++)
{ {
struct access *repr = VEC_index (access_p, representatives, i); struct access *repr;
for (repr = VEC_index (access_p, representatives, i);
repr;
repr = repr->next_grp)
{
VEC (access_p, heap) *access_vec; VEC (access_p, heap) *access_vec;
int j, access_count; int j, access_count;
tree parm; tree parm;
if (!repr || no_accesses_p (repr)) if (no_accesses_p (repr))
continue; continue;
parm = repr->base; parm = repr->base;
if (!POINTER_TYPE_P (TREE_TYPE (parm)) if (!POINTER_TYPE_P (TREE_TYPE (parm))
...@@ -2837,8 +2842,8 @@ analyze_modified_params (VEC (access_p, heap) *representatives) ...@@ -2837,8 +2842,8 @@ analyze_modified_params (VEC (access_p, heap) *representatives)
struct access *access; struct access *access;
ao_ref ar; ao_ref ar;
/* All accesses are read ones, otherwise grp_maybe_modified would be /* All accesses are read ones, otherwise grp_maybe_modified would
trivially set. */ be trivially set. */
access = VEC_index (access_p, access_vec, j); access = VEC_index (access_p, access_vec, j);
ao_ref_init (&ar, access->expr); ao_ref_init (&ar, access->expr);
walk_aliased_vdefs (&ar, gimple_vuse (access->stmt), walk_aliased_vdefs (&ar, gimple_vuse (access->stmt),
...@@ -2847,6 +2852,7 @@ analyze_modified_params (VEC (access_p, heap) *representatives) ...@@ -2847,6 +2852,7 @@ analyze_modified_params (VEC (access_p, heap) *representatives)
break; break;
} }
} }
}
} }
/* Propagate distances in bb_dereferences in the opposite direction than the /* Propagate distances in bb_dereferences in the opposite direction than the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment