aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2005-04-25 18:08:35 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2005-04-25 11:08:35 -0700
commit0453e74da8230c0b02e42e82df2358331dfc8592 (patch)
tree3a6ecadd21ecc446183bce31fb0a8581319cd4ec /gcc
parentcc7220fd0e78ebe5c963157b1272729540b62c9a (diff)
downloadgcc-0453e74da8230c0b02e42e82df2358331dfc8592.zip
gcc-0453e74da8230c0b02e42e82df2358331dfc8592.tar.gz
gcc-0453e74da8230c0b02e42e82df2358331dfc8592.tar.bz2
re PR c++/21188 (CbcModel.cpp:3571: internal compiler error: in compare_values, at tree-vrp.c:292)
2005-04-25 Andrew Pinski <pinskia@physics.uc.edu> PR C++/21188 * g++.dg/opt/rtti2.C: New test. 2005-04-25 Andrew Pinski <pinskia@physics.uc.edu> PR C++/21188 * rtti.c (ifnonnull): Cast the zero comparison operand to the correct type. From-SVN: r98726
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/rtti.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/opt/rtti2.C17
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 07f7daa..74b00a1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2005-04-25 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/21188
+ * rtti.c (ifnonnull): Cast the zero comparison operand
+ to the correct type.
+
2005-04-24 Jakub Jelinek <jakub@redhat.com>
PR middle-end/20991
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 1cad0bd..bff6c95 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -419,7 +419,8 @@ static tree
ifnonnull (tree test, tree result)
{
return build3 (COND_EXPR, TREE_TYPE (result),
- build2 (EQ_EXPR, boolean_type_node, test, integer_zero_node),
+ build2 (EQ_EXPR, boolean_type_node, test,
+ cp_convert (TREE_TYPE (test), integer_zero_node)),
cp_convert (TREE_TYPE (result), integer_zero_node),
result);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 479f1f4..10f42d1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-25 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/21188
+ * g++.dg/opt/rtti2.C: New test.
+
2005-04-25 Paul Brook <paul@codesourcery.com>
Steven G. Kargl <kargls@comcast.net>
diff --git a/gcc/testsuite/g++.dg/opt/rtti2.C b/gcc/testsuite/g++.dg/opt/rtti2.C
new file mode 100644
index 0000000..ebbe3cd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/rtti2.C
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// { dg-options "-O2" }
+// We used to ICE in compare_values as the types for a comparison
+// were not the same kind of types.
+
+struct class1
+{
+ virtual ~class1 ();
+};
+struct class2 : class1 { };
+
+void f(class1 * oo)
+{
+ class2 * oj = dynamic_cast <class2 *>(oo) ;
+ if (oj)
+ delete oo;
+}