[PATCH] Fix PR/7814 (3.2)
Glen Nakamura
glen@imodulo.com
Mon Sep 2 13:29:00 GMT 2002
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7814
Okay, I think the problem is that when we flush the dependency lists
(e.g. when ?_length > MAX_PENDING_LIST_LENGTH), we end up with a single
insn in the 'clobbers' list while the 'sets' and 'uses' lists are empty.
Now, if there is another clobber insn before any set or use insn, it won't
be dependent on any previous insn because the 'sets' and 'uses' lists
are empty... The problem is fixed by adding the last insn to the 'sets'
list after flushing.
- glen
Here is the patch:
ChangeLog
===================================================================
2002-09-02 Glen Nakamura <glen@imodulo.com>
* sched-deps.c (sched_analyze_insn): Make sure to add insn
to reg_last->sets after flushing the dependency lists to guarantee
that subsequent clobbers will be dependent on it.
Index: sched-deps.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/sched-deps.c,v
retrieving revision 1.34.6.1
diff -c -3 -p -u -r1.34.6.1 sched-deps.c
--- sched-deps.c 19 Aug 2002 18:59:31 -0000 1.34.6.1
+++ sched-deps.c 2 Sep 2002 06:35:15 -0000
@@ -1118,8 +1118,6 @@ sched_analyze_insn (deps, x, insn, loop_
EXECUTE_IF_SET_IN_REG_SET (reg_pending_clobbers, 0, i,
{
struct deps_reg *reg_last = &deps->reg_last[i];
- add_dependence_list (insn, reg_last->sets, REG_DEP_OUTPUT);
- add_dependence_list (insn, reg_last->uses, REG_DEP_ANTI);
if (reg_last->uses_length > MAX_PENDING_LIST_LENGTH
|| reg_last->clobbers_length > MAX_PENDING_LIST_LENGTH)
{
@@ -1129,6 +1127,7 @@ sched_analyze_insn (deps, x, insn, loop_
REG_DEP_ANTI);
add_dependence_list_and_free (insn, ®_last->clobbers,
REG_DEP_OUTPUT);
+ reg_last->sets = alloc_INSN_LIST (insn, reg_last->sets);
reg_last->clobbers_length = 0;
reg_last->uses_length = 0;
}
More information about the Gcc-patches
mailing list