summaryrefslogtreecommitdiffstats
path: root/gcc/loop.c
diff options
context:
space:
mode:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-29 11:56:45 +0000
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-29 11:56:45 +0000
commit092aa66ff178f8b757973c164357a255af5b1a18 (patch)
treef30603a88d3538b8e75b6362181fbee7df011d25 /gcc/loop.c
parent82f4ebf64cc27db125f4040bb1533c02d9015f27 (diff)
downloadppe42-gcc-092aa66ff178f8b757973c164357a255af5b1a18.tar.gz
ppe42-gcc-092aa66ff178f8b757973c164357a255af5b1a18.zip
* loop.c (maybe_eliminate_biv): For libcalls that set a giv, skip to
end of libcall. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26056 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r--gcc/loop.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 7b6ec8de6e2..a626784a02a 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -8121,6 +8121,26 @@ maybe_eliminate_biv (bl, loop_start, end, eliminate_p, threshold, insn_count)
enum rtx_code code = GET_CODE (p);
rtx where = threshold >= insn_count ? loop_start : p;
+ /* If this is a libcall that sets a giv, skip ahead to its end. */
+ if (GET_RTX_CLASS (code) == 'i')
+ {
+ rtx note = find_reg_note (p, REG_LIBCALL, NULL_RTX);
+
+ if (note)
+ {
+ rtx last = XEXP (note, 0);
+ rtx set = single_set (last);
+
+ if (set && GET_CODE (SET_DEST (set)) == REG)
+ {
+ int regno = REGNO (SET_DEST (set));
+
+ if (REG_IV_TYPE (regno) == GENERAL_INDUCT
+ && REG_IV_INFO (regno)->src_reg == bl->biv->src_reg)
+ p = last;
+ }
+ }
+ }
if ((code == INSN || code == JUMP_INSN || code == CALL_INSN)
&& reg_mentioned_p (reg, PATTERN (p))
&& ! maybe_eliminate_biv_1 (PATTERN (p), p, bl, eliminate_p, where))
OpenPOWER on IntegriCloud