diff options
author | Vladimir N. Makarov <vmakarov@redhat.com> | 2024-04-04 16:04:04 -0400 |
---|---|---|
committer | Vladimir N. Makarov <vmakarov@redhat.com> | 2024-04-04 16:07:10 -0400 |
commit | a24476422ba311b83737cf8bdc5892a7fc7514eb (patch) | |
tree | 16f9aa6f9f673beccf8d9835bb67866efb33014d /gcc/sched-int.h | |
parent | 7520a4992c94254016085a461c58c972497c4483 (diff) | |
download | gcc-a24476422ba311b83737cf8bdc5892a7fc7514eb.zip gcc-a24476422ba311b83737cf8bdc5892a7fc7514eb.tar.gz gcc-a24476422ba311b83737cf8bdc5892a7fc7514eb.tar.bz2 |
[PR114415][scheduler]: Fixing wrong code generation
For the test case, the insn scheduler (working for live range
shrinkage) moves insns modifying stack memory before an insn reserving
the stack memory. Comments in the patch contains more details about
the problem and its solution.
gcc/ChangeLog:
PR rtl-optimization/114415
* sched-deps.cc (add_insn_mem_dependence): Add memory check for mem argument.
(sched_analyze_1): Treat stack pointer modification as memory read.
(sched_analyze_2, sched_analyze_insn): Add memory guard for processing pending_read_mems.
* sched-int.h (deps_desc): Add comment to pending_read_mems.
gcc/testsuite/ChangeLog:
PR rtl-optimization/114415
* gcc.target/i386/pr114415.c: New test.
Diffstat (limited to 'gcc/sched-int.h')
-rw-r--r-- | gcc/sched-int.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/sched-int.h b/gcc/sched-int.h index 4df0920..85b1ddb 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -471,7 +471,9 @@ public: /* An INSN_LIST containing all insns with pending read operations. */ rtx_insn_list *pending_read_insns; - /* An EXPR_LIST containing all MEM rtx's which are pending reads. */ + /* An EXPR_LIST containing all MEM rtx's which are pending reads. The list + can contain stack pointer instead of memory. This is a special case (see + sched-deps.cc::sched_analyze_1). */ rtx_expr_list *pending_read_mems; /* An INSN_LIST containing all insns with pending write operations. */ |