]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/24103 (ICE in simple_cst_equal)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Fri, 2 Dec 2005 12:38:30 +0000 (12:38 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Fri, 2 Dec 2005 12:38:30 +0000 (12:38 +0000)
PR c++/24103
Backport:
2002-08-22  Diego Novillo  <dnovillo@redhat.com>

* tree.c (simple_cst_equal): Call simple_cst_list_equal to compare
CONSTRUCTOR_ELTS pointers.

PR c++/24103
* g++.dg/other/default1.C: New test.

From-SVN: r107888

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/default1.C [new file with mode: 0644]
gcc/tree.c

index 972cfd54216f16dabc240fe28049f4c59664190a..099f12bed4e1defb0f370cdce6e019b6357c8707 100644 (file)
@@ -1,3 +1,12 @@
+2005-12-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/24103
+       Backport:
+       2002-08-22  Diego Novillo  <dnovillo@redhat.com>
+
+       * tree.c (simple_cst_equal): Call simple_cst_list_equal to compare
+       CONSTRUCTOR_ELTS pointers.
+
 2005-12-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * version.c: Bump version number.
index 75b67062610af3c7e319daa7c90f6bce0d9d3b11..ee18a9ee23273cca2020a90312e23d9f8405847d 100644 (file)
@@ -1,3 +1,8 @@
+2005-12-02  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/24103
+       * g++.dg/other/default1.C: New test.
+
 2005-12-01  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        Backport:
diff --git a/gcc/testsuite/g++.dg/other/default1.C b/gcc/testsuite/g++.dg/other/default1.C
new file mode 100644 (file)
index 0000000..a6d9681
--- /dev/null
@@ -0,0 +1,22 @@
+// PR c++/24103
+// ICE in simple_cst_equal
+// Origin: Alexander Stepanov <astepanov@softminecorp.com>
+// { dg-do compile }
+// { dg-options "" }
+
+struct S
+{
+  int i;
+};
+
+struct A
+{
+  A(S = (S){0});
+};
+
+struct B
+{
+  B(S = (S){0});
+};
+
+B::B(S) {}
index c1ca94777596f4e0f7b6a5d9fe174a8ec23ac53e..a9b6d1a9b757e1357fafa1b4757f720364277aa1 100644 (file)
@@ -3417,10 +3417,8 @@ simple_cst_equal (tree t1, tree t2)
                         TREE_STRING_LENGTH (t1)));
 
     case CONSTRUCTOR:
-      if (CONSTRUCTOR_ELTS (t1) == CONSTRUCTOR_ELTS (t2))
-       return 1;
-      else
-       abort ();
+      return simple_cst_list_equal (CONSTRUCTOR_ELTS (t1),
+                                   CONSTRUCTOR_ELTS (t2));
 
     case SAVE_EXPR:
       return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));