mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-20 08:10:28 +08:00
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:
parent
cc7220fd0e
commit
0453e74da8
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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>
|
||||
|
||||
|
17
gcc/testsuite/g++.dg/opt/rtti2.C
Normal file
17
gcc/testsuite/g++.dg/opt/rtti2.C
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user