[Bug c++/18968] [4.0 regression] ICE: tree check: expected ssa_name, have addr_expr in vrp_hash

law at redhat dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 14 00:42:00 GMT 2004


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



More information about the Gcc-bugs mailing list