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
This commit is contained in:
Andrew Pinski 2005-04-25 18:08:35 +00:00 committed by Andrew Pinski
parent cc7220fd0e
commit 0453e74da8
4 changed files with 30 additions and 1 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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>

View File

@ -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;
}