From: Richard Guenther Date: Tue, 17 Feb 2009 16:01:53 +0000 (+0000) Subject: re PR tree-optimization/39202 (internal compiler error: in collapse_rest_of_var,... X-Git-Tag: releases/gcc-4.4.0~524 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b24ee26e51ea066a5324578c95a0256dbd7a5c6;p=thirdparty%2Fgcc.git re PR tree-optimization/39202 (internal compiler error: in collapse_rest_of_var, at tree-ssa-structalias.c:3296) 2009-02-17 Richard Guenther PR tree-optimization/39202 * tree-ssa-structalias.c (do_structure_copy): Before collapsing a var make sure to follow existing collapses. * gcc.c-torture/compile/pr39202.c: New testcase. From-SVN: r144235 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4be34763d08..6947e99f36f9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-02-17 Richard Guenther + + PR tree-optimization/39202 + * tree-ssa-structalias.c (do_structure_copy): Before collapsing + a var make sure to follow existing collapses. + 2009-02-17 Richard Guenther PR middle-end/39214 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bf7b705f6cd4..5b620d4eeacf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-02-17 Richard Guenther + + PR tree-optimization/39202 + * gcc.c-torture/compile/pr39202.c: New testcase. + 2009-02-17 Richard Guenther PR tree-optimization/39204 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39202.c b/gcc/testsuite/gcc.c-torture/compile/pr39202.c new file mode 100644 index 000000000000..f79b83194a96 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr39202.c @@ -0,0 +1,33 @@ +typedef struct +{ + union + { + int * aaa; + } u; +} t_a; + +typedef struct +{ + unsigned bbb : 1; +} t_b; + +typedef struct +{ + int ccc; + t_a ddd; + t_b eee; + int fff; +} t_c; + +typedef struct t_d +{ + t_c f1; + t_c f2; +} t_d; + +void foo (void) +{ + t_d ggg; + ggg.f1 = ggg.f2; +} + diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index f9962b33a98d..8f8879694275 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -3405,8 +3405,8 @@ do_structure_copy (tree lhsop, tree rhsop) { if (!do_simple_structure_copy (lhs, rhs, MIN (lhssize, rhssize))) { - lhs.var = collapse_rest_of_var (lhs.var); - rhs.var = collapse_rest_of_var (rhs.var); + lhs.var = collapse_rest_of_var (get_varinfo_fc (lhs.var)->id); + rhs.var = collapse_rest_of_var (get_varinfo_fc (rhs.var)->id); lhs.offset = 0; rhs.offset = 0; lhs.type = SCALAR;