Commit 363e01cc by Martin Jambor Committed by Martin Jambor

re PR middle-end/46734 (ICE in create_tmp_var, at gimplify.c:505)

2010-12-09  Martin Jambor  <mjambor@suse.cz>

	PR middle-end/46734
	* tree-sra.c (splice_param_accesses): Check that there are not
	multiple ADDRESSABLE types.

	* testsuite/g++.dg/tree-ssa/pr46734.C: New test.

From-SVN: r167639
parent 8b6606f2
2010-12-09 Martin Jambor <mjambor@suse.cz>
PR middle-end/46734
* tree-sra.c (splice_param_accesses): Check that there are not
multiple ADDRESSABLE types.
2010-12-09 Joseph Myers <joseph@codesourcery.com> 2010-12-09 Joseph Myers <joseph@codesourcery.com>
* config/arc/arc.h (ASM_SPEC): Remove %{v}. * config/arc/arc.h (ASM_SPEC): Remove %{v}.
2010-12-09 Martin Jambor <mjambor@suse.cz>
PR middle-end/46734
* g++.dg/tree-ssa/pr46734.C: New test.
2010-12-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2010-12-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR c++/44641 PR c++/44641
......
/* { dg-do compile } */
/* { dg-options "-O -fipa-sra" } */
struct A
{
int *p;
A() {p = (int *) -1;}
~A() {if (p && p != (int *) -1) *p = 0;}
};
struct B
{
A a;
char data[23];
B() : a() {data[0] = 0;}
};
extern A ga;
extern int *gi;
extern void *gz;
extern B *gb;
static int * __attribute__ ((noinline)) foo (B *b, void *z)
{
__builtin_memcpy (gz, z, 28);
ga = b->a;
return b->a.p;
}
int *bar (B *b, void *z)
{
gb = b;
return foo (b, z);
}
...@@ -3587,7 +3587,10 @@ splice_param_accesses (tree parm, bool *ro_grp) ...@@ -3587,7 +3587,10 @@ splice_param_accesses (tree parm, bool *ro_grp)
else if (ac2->size != access->size) else if (ac2->size != access->size)
return NULL; return NULL;
if (access_precludes_ipa_sra_p (ac2)) if (access_precludes_ipa_sra_p (ac2)
|| (ac2->type != access->type
&& (TREE_ADDRESSABLE (ac2->type)
|| TREE_ADDRESSABLE (access->type))))
return NULL; return NULL;
modification |= ac2->write; modification |= ac2->write;
......
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