aboutsummaryrefslogtreecommitdiff
path: root/gcc/sched-deps.c
diff options
context:
space:
mode:
authorDinar Temirbulatov <dinar@kugelworks.com>2013-05-31 23:20:17 +0000
committerDinar Temirbulatov <dinar@gcc.gnu.org>2013-06-01 03:20:17 +0400
commitc359d8d046a4c0d773979c6668d34a80d9ae99a5 (patch)
treeedd8376734de32bbfe9406a6aae957335d439222 /gcc/sched-deps.c
parentdc801ca2dea2817571043270854c5c2261fb4874 (diff)
downloadgcc-c359d8d046a4c0d773979c6668d34a80d9ae99a5.zip
gcc-c359d8d046a4c0d773979c6668d34a80d9ae99a5.tar.gz
gcc-c359d8d046a4c0d773979c6668d34a80d9ae99a5.tar.bz2
re PR rtl-optimization/57268 (c nested loops hang compiler in sched-deps.c)
2013-05-31 Dinar Temirbulatov <dinar@kugelworks.com> PR rtl-optimization/57268 * sched-deps.c (sched_analyze_2): Flush dependence lists if the sum of the read and write lists exceeds MAX_PENDING_LIST_LENGTH. From-SVN: r199564
Diffstat (limited to 'gcc/sched-deps.c')
-rw-r--r--gcc/sched-deps.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index c7ef1d8..190fd4e 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -2690,8 +2690,14 @@ sched_analyze_2 (struct deps_desc *deps, rtx x, rtx insn)
/* Always add these dependencies to pending_reads, since
this insn may be followed by a write. */
- if (!deps->readonly)
- add_insn_mem_dependence (deps, true, insn, x);
+ if (!deps->readonly)
+ {
+ if ((deps->pending_read_list_length
+ + deps->pending_write_list_length)
+ > MAX_PENDING_LIST_LENGTH)
+ flush_pending_lists (deps, insn, true, true);
+ add_insn_mem_dependence (deps, true, insn, x);
+ }
sched_analyze_2 (deps, XEXP (x, 0), insn);