https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99859

--- Comment #14 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #11)
> For the global vars (so PR80039 too), can the problem be anything but when
> cxx_eval_outermost_constant_expr is called on such an object (or part
> thereof)?
> Unfortunately, ctx->object might be NULL, perhaps we could stick a copy of
> that into ctx->global->object (get_base_address of the outermost object it
> is called on)?

Sounds good to me FWIW

(In reply to Jakub Jelinek from comment #13)
> (In reply to Jakub Jelinek from comment #12)
> > And in #c9 you're right that it could be embedded in CONSTRUCTORs too.
> 
> Wonder if cp_walk_tree &arg to find the ADDR_EXPR of heap var addresses and
> ctx->global->object address would be enough.

Sounds good to me too.  Using cp_walk_tree means we'd also detect the case
where the argument is 'heap_ptr + CST'.

Reply via email to