summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/loop.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2002-12-04 15:42:16 +0000
committerobrien <obrien@FreeBSD.org>2002-12-04 15:42:16 +0000
commit7a1080fa5c329ea8a9505e51ce151719955bcfa2 (patch)
tree78b77287e56e2a87be73638176124be85a8fc6c7 /contrib/gcc/loop.c
parentef3bb1318428b8cfb1c8287f61b9b1f23f9bf0b5 (diff)
downloadFreeBSD-src-7a1080fa5c329ea8a9505e51ce151719955bcfa2.zip
FreeBSD-src-7a1080fa5c329ea8a9505e51ce151719955bcfa2.tar.gz
Gcc 3.2.1 release virgin vendor import. (19-Nov-2002)
Diffstat (limited to 'contrib/gcc/loop.c')
-rw-r--r--contrib/gcc/loop.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/gcc/loop.c b/contrib/gcc/loop.c
index 732a84d..149e7d1 100644
--- a/contrib/gcc/loop.c
+++ b/contrib/gcc/loop.c
@@ -9560,6 +9560,25 @@ loop_regs_scan (loop, extra_size)
if (GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == JUMP_INSN)
memset (last_set, 0, regs->num * sizeof (rtx));
+
+ /* Invalidate all registers used for function argument passing.
+ We check rtx_varies_p for the same reason as below, to allow
+ optimizing PIC calculations. */
+ if (GET_CODE (insn) == CALL_INSN)
+ {
+ rtx link;
+ for (link = CALL_INSN_FUNCTION_USAGE (insn);
+ link;
+ link = XEXP (link, 1))
+ {
+ rtx op, reg;
+
+ if (GET_CODE (op = XEXP (link, 0)) == USE
+ && GET_CODE (reg = XEXP (op, 0)) == REG
+ && rtx_varies_p (reg, 1))
+ regs->array[REGNO (reg)].may_not_optimize = 1;
+ }
+ }
}
/* Invalidate all hard registers clobbered by calls. With one exception:
OpenPOWER on IntegriCloud