re PR c++/18968 (ICE: tree check: expected ssa_name, have addr_expr in vrp_hash)

2004-12-13  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/18968
        * g++.dg/opt/pr18968.C: New test.

2004-12-13  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/18968
        * class.c (build_base_path): Convert the zero constant to the correct
        type when comparing.

From-SVN: r92121
This commit is contained in:
Andrew Pinski 2004-12-14 02:21:56 +00:00 committed by Andrew Pinski
parent 532b37d9b8
commit 471a58a941
4 changed files with 34 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2004-12-13 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/18968
* class.c (build_base_path): Convert the zero constant to the correct
type when comparing.
2004-12-13 Mark Mitchell <mark@codesourcery.com>
PR c++/18925

View File

@ -295,8 +295,11 @@ build_base_path (enum tree_code code,
/* Now that we've saved expr, build the real null test. */
if (null_test)
null_test = fold (build2 (NE_EXPR, boolean_type_node,
expr, integer_zero_node));
{
tree zero = cp_convert (TREE_TYPE (expr), integer_zero_node);
null_test = fold (build2 (NE_EXPR, boolean_type_node,
expr, zero));
}
/* If this is a simple base reference, express it as a COMPONENT_REF. */
if (code == PLUS_EXPR && !virtual_access

View File

@ -1,3 +1,8 @@
2004-12-13 Andrew Pinski <pinskia@physics.uc.edu>
PR c++/18968
* g++.dg/opt/pr18968.C: New test.
2004-12-13 Mark Mitchell <mark@codesourcery.com>
PR c++/18925

View File

@ -0,0 +1,18 @@
// { dg-do compile }
// { dg-options "-O1" }
struct X
{
int i;
};
struct Y : virtual X {};
struct Z : Y {};
struct A
{
Z* p;
A();
};
A::A() : p(0)
{
((X*)(Y*)p)->i++;
}