This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18968] [4.0 regression] ICE: tree check: expected ssa_name, have addr_expr in vrp_hash
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Dec 2004 00:42:35 -0000
- Subject: [Bug c++/18968] [4.0 regression] ICE: tree check: expected ssa_name, have addr_expr in vrp_hash
- References: <20041213212814.18968.schwab@suse.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From law at redhat dot com 2004-12-14 00:42 -------
Subject: Re: [4.0 regression] ICE: tree check: expected
ssa_name, have addr_expr in vrp_hash
On Mon, 2004-12-13 at 23:18 +0000, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-13 23:18 -------
> (In reply to comment #7)
> > Subject: Re: [4.0 regression] ICE: tree
> > check: expected ssa_name, have addr_expr in vrp_hash
> >
> > So what does the condition look like? I don't think we should be
> > getting into this code with anything other than an SSA_NAME as
> > the first argument in a COND_EXPR.
> Sorry about that, I was still working through the code of DOM.
>
> The condition looks like &0B->a == 0 which means that the 0 is an integer but other size of the equal
> expression is a pointer. This means that the types are mismatched by the front-end.
> This patch is the correct fix which fixes the problem in the front-end which fixes the mismatched types:
> Index: class.c
> ===============================================================
> ====
> RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v
> retrieving revision 1.692
> diff -u -p -r1.692 class.c
> --- class.c 8 Dec 2004 08:35:33 -0000 1.692
> +++ class.c 13 Dec 2004 23:12:29 -0000
> @@ -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
Looks pretty reasonable to me. Assuming it passes a regression test
consider it pre-approved along with a suitable entry for the testsuite.
Thanks,
jeff
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18968