From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5789E398B85C; Mon, 28 Jun 2021 20:00:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5789E398B85C From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101219] [12 Regression] ice in perform_or_defer_access_check since r12-1804-g65870e75616ee435 Date: Mon, 28 Jun 2021 20:00:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2021 20:00:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101219 --- Comment #3 from Martin Sebor --- The code fails in the assert below where binfo is null. The full stack tra= ce follows. The difference is that before r12-1804 warn_for_null_address() w= ould return without doing anything because TREE_NO_WARNING(op) was 1. r12-1804 changed the TREE_NO_WARNING(op) test to warning_suppressed_p (op, OPT_Waddress)) which returns false. The no-warning bit on OP is also clear= so something has caused it to not be set. Possibly a subtle difference in the location value. Whatever has caused the change, it seems like the root cau= se of the ICE is something else (unless the front end somehow relies on the no-warning bit to also mean something else than just "disable warnings"). bool perform_or_defer_access_check (tree binfo, tree decl, tree diag_decl, tsubst_flags_t complain, access_failure_info *afi) { int i; deferred_access *ptr; deferred_access_check *chk; /* Exit if we are in a context that no access checking is performed. */ if (deferred_access_no_check) return true; gcc_assert (TREE_CODE (binfo) =3D=3D TREE_BINFO); 0x1717bc8 crash_signal /ssd/src/gcc/master/gcc/toplev.c:328 0xdf00fb perform_or_defer_access_check(tree_node*, tree_node*, tree_node*, = int, access_failure_info*) /ssd/src/gcc/master/gcc/cp/semantics.c:490 0xdf6a7d finish_non_static_data_member(tree_node*, tree_node*, tree_node*) /ssd/src/gcc/master/gcc/cp/semantics.c:2208 0xda8762 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, boo= l, bool) /ssd/src/gcc/master/gcc/cp/pt.c:20568 0xd5d6cc instantiate_non_dependent_expr_internal(tree_node*, int) /ssd/src/gcc/master/gcc/cp/pt.c:6323 0xad622f fold_non_dependent_expr_template /ssd/src/gcc/master/gcc/cp/constexpr.c:7604 0xad6585 fold_non_dependent_expr(tree_node*, int, bool, tree_node*) /ssd/src/gcc/master/gcc/cp/constexpr.c:7661 0xbda7c4 fold_for_warn(tree_node*) /ssd/src/gcc/master/gcc/cp/expr.c:409 0xe67e56 warn_for_null_address /ssd/src/gcc/master/gcc/cp/typeck.c:4453 0xe6a880 cp_build_binary_op(op_location_t const&, tree_code, tree_node*, tree_node*, int) /ssd/src/gcc/master/gcc/cp/typeck.c:5169 0xe6b0ff cp_build_binary_op(op_location_t const&, tree_code, tree_node*, tree_node*, int) /ssd/src/gcc/master/gcc/cp/typeck.c:5357 0xa59d4c build_new_op_1 /ssd/src/gcc/master/gcc/cp/call.c:6760 0xa59e57 build_new_op(op_location_t const&, tree_code, int, tree_node*, tree_node*, tree_node*, tree_node**, int) /ssd/src/gcc/master/gcc/cp/call.c:6806 0xe6774c build_x_binary_op(op_location_t const&, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node**, int) /ssd/src/gcc/master/gcc/cp/typeck.c:4330 0xcd6d2c cp_parser_binary_expression /ssd/src/gcc/master/gcc/cp/parser.c:10023 0xcd7229 cp_parser_assignment_expression /ssd/src/gcc/master/gcc/cp/parser.c:10163 0xcd7608 cp_parser_expression /ssd/src/gcc/master/gcc/cp/parser.c:10331 0xcdb75c cp_parser_expression_statement /ssd/src/gcc/master/gcc/cp/parser.c:12075 0xcdafe1 cp_parser_statement /ssd/src/gcc/master/gcc/cp/parser.c:11871 0xcdbd17 cp_parser_statement_seq_opt /ssd/src/gcc/master/gcc/cp/parser.c:12223=