]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/39202 (internal compiler error: in collapse_rest_of_var,...
authorRichard Guenther <rguenther@suse.de>
Tue, 17 Feb 2009 16:01:53 +0000 (16:01 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 17 Feb 2009 16:01:53 +0000 (16:01 +0000)
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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr39202.c [new file with mode: 0644]
gcc/tree-ssa-structalias.c

index d4be34763d0825cf198c8c3e1cc4457b96ce1196..6947e99f36f96a09c7c88c1eea21710199551522 100644 (file)
@@ -1,3 +1,9 @@
+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
index bf7b705f6cd43a42a376dff9d8b04c5b14f735f4..5b620d4eeacf6526b83b4f9fc99939905a7193c3 100644 (file)
@@ -1,3 +1,8 @@
+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
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr39202.c b/gcc/testsuite/gcc.c-torture/compile/pr39202.c
new file mode 100644 (file)
index 0000000..f79b831
--- /dev/null
@@ -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;
+}
+
index f9962b33a98d638c66011e91a766be757c49c838..8f8879694275eeb3e7256bd36b301d0cb1bbd722 100644 (file)
@@ -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;