https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100537
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cmang at google dot com,
| |iant at google dot com
Assignee|unassigned at gcc dot gnu.org |ian at airs dot com
Component|middle-end |go
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the issue is that the go FE creates go..C479 and it somewhere builds the
address of it but fails to set TREE_ADDRESSABLE. There are only a few
build_fold_addr_expr calls in the FE:
> grep -r build_fold_addr .
./go-gcc.cc: tree t = build_fold_addr_expr_loc(location.gcc_location(),
this->t_);
./go-gcc.cc: tree ret = build_fold_addr_expr_loc(location.gcc_location(),
func);
./go-gcc.cc: tree ret = build_fold_addr_expr_loc(location.gcc_location(),
expr);
./go-gcc.cc: fn = build_fold_addr_expr_loc(location.gcc_location(),
./go-gcc.cc:
build_fold_addr_expr_loc(location.gcc_location(),
one does mark the object addressable but all the others do not. So for
those who can reproduce, run the failing compile in a debugger, see
which ADDR_EXPR we complain about and then set a breakpoint in
ggc_internal_alloc conditional on the return value being this ADDR_EXPR.
That should nail one of the above after which you should call
mark_addressable on the object.