From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 314D13857713; Thu, 27 Apr 2023 18:07:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 314D13857713 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682618854; bh=B7PgmJmR2W6biFV18U19ypnBGcPHVGgceduAmdcPqg8=; h=From:To:Subject:Date:From; b=cfEA12qfIKPd+OhYhjbQFLFROAQiVz1mNX9rwOxSTDCZuIDFNmnRjNvWlkcqqBEys av/F0ZUZXY6vpn3VyTxSXfTt5BG42GmLwCQ8KNZ16eAxVdPXEuWYVqY2ebJGLQUYpq UQUT2LB83sPffZDn/K3ItuL8L30EyakWHKFu1SxE= From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/109652] New: [14 Regression] ICE on valgrind-3.20.0: in modify_expression, at ipa-param-manipulation.cc:1866 Date: Thu, 27 Apr 2023 18:07:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109652 Bug ID: 109652 Summary: [14 Regression] ICE on valgrind-3.20.0: in modify_expression, at ipa-param-manipulation.cc:1866 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- Got the ICE on valgrind-3.20.0 against today's gcc master ( r14-300-g65369ab62cee68 ). Minimal reproducer: // $ cat bug.c.c typedef int UInt; UInt skeletal_RI5_instr; __attribute__((__noreturn__)) void vex_assert_fail(); typedef struct { union { struct { UInt imm5; } I5; } ARMri5; } ARMRI5; typedef enum { ARMin_Alu, ARMin_Shift } ARMInstrTag; void iregEnc(); static UInt skeletal_RI5(ARMRI5 *ri) { UInt imm5 =3D ri->ARMri5.I5.imm5; __builtin_expect(imm5, 1) ?: vex_assert_fail(); iregEnc(ri->ARMri5); return skeletal_RI5_instr; } ARMInstrTag emit_ARMInstr_i_0; void *emit_ARMInstr_disp_cp_chain_me_to_slowEP() { switch (emit_ARMInstr_i_0) { case ARMin_Alu: UInt instr, subopc; UInt rD, rN; goto bad; instr |=3D subopc | rN; case ARMin_Shift: rD =3D 0; UInt rM =3D 0; ARMRI5 argR; instr =3D skeletal_RI5(&argR); instr |=3D rD | rM; goto done; } bad: done: return 0; } Crashing: $ gcc -O2 -c bug.c.c -o bug.o during IPA pass: inline In function 'skeletal_RI5.isra': cc1: internal compiler error: in modify_expression, at ipa-param-manipulation.cc:1866 0x69367d ipa_param_body_adjustments::modify_expression(tree_node**, bool, gimple**) ../../source/gcc/ipa-param-manipulation.cc:1866 0xa7f038 ipa_param_body_adjustments::modify_call_stmt(gcall**, gimple*) ../../source/gcc/ipa-param-manipulation.cc:2165 0xcfd246 remap_gimple_stmt ../../source/gcc/tree-inline.cc:1961 0xd003f8 copy_bb ../../source/gcc/tree-inline.cc:2056 0xd0171f copy_cfg_body ../../source/gcc/tree-inline.cc:3069 0xd0171f copy_body ../../source/gcc/tree-inline.cc:3322 0xd0424a tree_function_versioning(tree_node*, tree_node*, vec*, ipa_param_adjustments*, bool, bitmap_head*, basic_block_def*) ../../source/gcc/tree-inline.cc:6347 0x852aae cgraph_node::materialize_clone() ../../source/gcc/cgraphclones.cc:1155 0x842f85 cgraph_node::get_untransformed_body() ../../source/gcc/cgraph.cc:3992 0xa3ee05 maybe_materialize_called_clones ../../source/gcc/ipa-inline-transform.cc:720 0xa40b8b inline_transform(cgraph_node*) ../../source/gcc/ipa-inline-transform.cc:777 0xb9796f execute_one_ipa_transform_pass ../../source/gcc/passes.cc:2343 0xb9796f execute_all_ipa_transforms(bool) ../../source/gcc/passes.cc:2406 0x84d83f cgraph_node::expand() ../../source/gcc/cgraphunit.cc:1834 0x84d83f cgraph_node::expand() ../../source/gcc/cgraphunit.cc:1794 0x84ee2a expand_all_functions ../../source/gcc/cgraphunit.cc:2024 0x84ee2a symbol_table::compile() ../../source/gcc/cgraphunit.cc:2398 0x8513a7 symbol_table::compile() ../../source/gcc/cgraphunit.cc:2311 0x8513a7 symbol_table::finalize_compilation_unit() ../../source/gcc/cgraphunit.cc:2583 $ gcc -v Using built-in specs. COLLECT_GCC=3D/<>/gcc-14.0.0/bin/gcc COLLECT_LTO_WRAPPER=3D/<>/gcc-14.0.0/libexec/gcc/x86_64-unknown-linux-= gnu/14.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix Supported LTO compression algorithms: zlib gcc version 14.0.0 99999999 (experimental) (GCC)=