mirrored from git://gcc.gnu.org/git/gcc.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <jakub@redhat.com> 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<mode>): 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.
- Loading branch information
1 parent
acc0ee5
commit decd8fb
Showing
3 changed files
with
39 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* PR target/99104 */ | ||
/* { dg-do compile { target int128 } } */ | ||
/* { dg-options "-O2 -fsel-sched-pipelining -fselective-scheduling2 -funroll-loops" } */ | ||
|
||
__int128 a; | ||
int b; | ||
int foo (void); | ||
|
||
int __attribute__ ((simd)) | ||
bar (void) | ||
{ | ||
a = ~a; | ||
if (foo ()) | ||
b = 0; | ||
} |