From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AEF8C38560BB; Wed, 25 May 2022 07:43:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AEF8C38560BB From: "linkw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/105459] [12/13 Regression] ICE: Segmentation fault (in record_operand_costs) since r12-3721-g63c6446f77b9001d Date: Wed, 25 May 2022 07:43:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: linkw at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: linkw at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.2 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: Wed, 25 May 2022 07:43:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105459 --- Comment #10 from Kewen Lin --- (In reply to Kewen Lin from comment #8) > (In reply to Kewen Lin from comment #7) > > I wonder if it's fine to move init_function_start downward after > > execute_all_ipa_transforms call? the testing is ongoing. >=20 > This proposed patch was bootstrapped and regress-tested. I think it's > reasonable as it can avoid uninitialized target global issue (on secondary > members) exposed by this bug. >=20 Just noticed that in execute_pass_list (cfun, g->get_passes ()->all_passes), it's still possible in theory to change the cfun and cause the possible tar= get global creation (call save_target_globals_default_opts for a totally new ta= rget option node, I think it wants copying actually) in target hook. Although the proposed fix can make the ICE gone, this issue gets exposed is due to the special handlings introduced by r11-5855 which creates target globals again. Technically speaking we can create one new target option node and with a new target globals in set_current_function hook without any restricted conditio= ns, then this issue can be exposed easily. Not sure this kind of need would bec= ome popular or not, if yes, we probably need to add one deep copy interface for target globals when its previous target global having this_target_rtl->target_specific_initialized true.=