diff options
author | Richard Guenther <rguenther@suse.de> | 2009-02-17 16:01:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2009-02-17 16:01:53 +0000 |
commit | 6b24ee26e51ea066a5324578c95a0256dbd7a5c6 (patch) | |
tree | a5861330ce269fc0e2f0fb5f3a8d6f41fcd0c03e /gcc | |
parent | 91ab2c868e9570a958c4884415d580c7bcd933f3 (diff) | |
download | gcc-6b24ee26e51ea066a5324578c95a0256dbd7a5c6.zip gcc-6b24ee26e51ea066a5324578c95a0256dbd7a5c6.tar.gz gcc-6b24ee26e51ea066a5324578c95a0256dbd7a5c6.tar.bz2 |
re PR tree-optimization/39202 (internal compiler error: in collapse_rest_of_var, at tree-ssa-structalias.c:3296)
2009-02-17 Richard Guenther <rguenther@suse.de>
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr39202.c | 33 | ||||
-rw-r--r-- | gcc/tree-ssa-structalias.c | 4 |
4 files changed, 46 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d4be347..6947e99 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2009-02-17 Richard Guenther <rguenther@suse.de> + 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 <rguenther@suse.de> + PR middle-end/39214 * langhooks.c (lhd_print_error_function): Check for NULL block. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bf7b705..5b620d4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2009-02-17 Richard Guenther <rguenther@suse.de> + PR tree-optimization/39202 + * gcc.c-torture/compile/pr39202.c: New testcase. + +2009-02-17 Richard Guenther <rguenther@suse.de> + PR tree-optimization/39204 * gcc.dg/torture/pr39204.c: New testcase. 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 0000000..f79b831 --- /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 f9962b3..8f88796 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; |