[Bug c++/112427] [14 regression] ICE when building Minetest (internal compiler error: tree check: expected tree that contains ‘decl common’ structure, have ‘identifier_node’ in get_inner_reference, at expr.cc:7931) since r14-4793-gdad311874ac3b3
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 15 17:10:59 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112427
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:d3f48f682271ed94ab6e9f6bc62418a62bd8ff26
commit r14-5503-gd3f48f682271ed94ab6e9f6bc62418a62bd8ff26
Author: Patrick Palka <ppalka@redhat.com>
Date: Wed Nov 15 12:10:16 2023 -0500
c++: non-dependent .* operand folding [PR112427]
Here when building up the non-dependent .* expression, we crash from
fold_convert on 'b.a' due to this (templated) COMPONENT_REF having an
IDENTIFIER_NODE instead of FIELD_DECL operand that middle-end routines
expect. Like in r14-4899-gd80a26cca02587, this patch fixes this by
replacing the problematic piecemeal folding with a single call to
cp_fully_fold. Also, don't bother building the POINTER_PLUS_EXPR in a
template context. This means the returned non-dependent tree might not
have TREE_SIDE_EFFECTS set when it used to, so we need to compensate
by making build_min_non_dep propagate TREE_SIDE_EFFECTS from the original
arguments like buildN and build_min do.
PR c++/112427
gcc/cp/ChangeLog:
* tree.cc (build_min_non_dep): Propagate TREE_SIDE_EFFECTS from
the original arguments.
(build_min_non_dep_call_vec): Likewise.
* typeck2.cc (build_m_component_ref): Use cp_convert, build2 and
cp_fully_fold instead of fold_build_pointer_plus and fold_convert.
Don't build the POINTER_PLUS_EXPR in a template context.
gcc/testsuite/ChangeLog:
* g++.dg/template/non-dependent29.C: New test.
More information about the Gcc-bugs
mailing list