This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 29585: C++ front end not setting TREE_ADDRESSABLE on vtbl entries


Mike Stump wrote:

> --- ./cp/class.c.~1~    2007-04-04 19:37:15.000000000 -0700
> +++ ./cp/class.c    2007-04-10 17:34:46.000000000 -0700
> @@ -7108,7 +7108,7 @@ dfs_accumulate_vtbl_inits (tree binfo,
>        index = size_binop (MULT_EXPR,
>                TYPE_SIZE_UNIT (vtable_entry_type),
>                index);
> -      vtbl = build2 (PLUS_EXPR, TREE_TYPE (vtbl), vtbl, index);
> +      vtbl = build2 (PLUS_EXPR, vtbl_ptr_type_node, vtbl, index);

That does not look to be type-correct at the tree level; the type of
VTBL + INDEX should be the same as the type of VTBL.  You should
probably be using fold_convert to add the conversion, after the addition.

> I'll check this in tomorrow unless a maintainer of the code thinks it's not obvious or wrong, pretty sure it's better than the status quo.

I think that you should consider recalibrating your obviousness meter.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]