From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0983F386F47C; Thu, 18 Feb 2021 08:22:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0983F386F47C From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99104] [11 Regression] ICE: Segmentation fault (in bitmap_list_find_element) Date: Thu, 18 Feb 2021 08:22:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 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: Thu, 18 Feb 2021 08:22:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99104 --- Comment #6 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:decd8fb0128870d0d768ba53dae626913d6d9c54 commit r11-7274-gdecd8fb0128870d0d768ba53dae626913d6d9c54 Author: Jakub Jelinek Date: Thu Feb 18 09:16:28 2021 +0100 i386: Fix up df uses in i386 splitters [PR99104] The following testcase started ICEing with my recent changes to enable split4 after sel-sched, but it seems the bug is more general. Some of the i386 splitter condition functions use and rely on df, but the split passes don't really df_analyze/df_finish_pass, so the DF info may be stale or not computed at all - the particular ICE is because there is a new bb and df_get_live_out (bb) returns NULL on it as the live or lr problem has not been computed yet. This patch fixes it by not calling ix86_ok_to_clobber_flags from ix86_avoid_lea_for_add where it wasn't ever needed because the splitters using that function as condition have (clobber FLAGS) in their pattern. And, changes the ix86_avoid_lea_for_addr using splitter from normal splitter to peephole2 splitter that uses peep2_regno_dead_p infrastructure to determine if FLAGS is dead. Also, it saves and restores recog_data variable around the call to distance_non_agu_define and doesn't call extract_insn_data there, because split_insns or peephole2_insns just clear recog_data.insn and then fill in recog_data.operand array, and so might not match what extract_insn will do on the insn at all. 2021-02-18 Jakub Jelinek PR target/99104 * config/i386/i386.c (distance_non_agu_define): Don't call extract_insn_cached here. (ix86_lea_outperforms): Save and restore recog_data around call to distance_non_agu_define and distance_agu_use. (ix86_ok_to_clobber_flags): Remove. (ix86_avoid_lea_for_add): Don't call ix86_ok_to_clobber_flags. (ix86_avoid_lea_for_addr): Likewise. Adjust function comment. * config/i386/i386.md (*lea): Change from define_insn_and_split into define_insn. Move the splitting to define_peephole2 and check there using peep2_regno_dead_p if FLAGS_REG is dead. * gcc.dg/pr99104.c: New test.=