aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@freesoft.cz>1999-04-13 16:50:49 +0200
committerRichard Henderson <rth@gcc.gnu.org>1999-04-13 07:50:49 -0700
commitb985a30f322f6e5d744e1b70a6d83e238543d652 (patch)
tree9185c012683c2a7aaef1b88d8a4d2514dbe3e4a0 /gcc/config
parent6e383e61963c7291c615632fd14b78a503ebb55d (diff)
downloadgcc-b985a30f322f6e5d744e1b70a6d83e238543d652.zip
gcc-b985a30f322f6e5d744e1b70a6d83e238543d652.tar.gz
gcc-b985a30f322f6e5d744e1b70a6d83e238543d652.tar.bz2
Jan Hubicka <hubicka@freesoft.cz>
Jan Hubicka <hubicka@freesoft.cz> * i386.c (agi_dependent): Handle push operation more correctly. From-SVN: r26412
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index ab54235..e6f807b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -5037,16 +5037,36 @@ int
agi_dependent (insn, dep_insn)
rtx insn, dep_insn;
{
+ int push = 0, push_dep = 0;
if (GET_CODE (dep_insn) == INSN
&& GET_CODE (PATTERN (dep_insn)) == SET
- && GET_CODE (SET_DEST (PATTERN (dep_insn))) == REG)
- return reg_mentioned_in_mem (SET_DEST (PATTERN (dep_insn)), insn);
+ && GET_CODE (SET_DEST (PATTERN (dep_insn))) == REG
+ && reg_mentioned_in_mem (SET_DEST (PATTERN (dep_insn)), insn))
+ return 1;
+
+ if (GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SET
+ && GET_CODE (SET_DEST (PATTERN (insn))) == MEM
+ && push_operand (SET_DEST (PATTERN (insn)),
+ GET_MODE (SET_DEST (PATTERN (insn)))))
+ push = 1;
if (GET_CODE (dep_insn) == INSN && GET_CODE (PATTERN (dep_insn)) == SET
&& GET_CODE (SET_DEST (PATTERN (dep_insn))) == MEM
&& push_operand (SET_DEST (PATTERN (dep_insn)),
GET_MODE (SET_DEST (PATTERN (dep_insn)))))
- return reg_mentioned_in_mem (stack_pointer_rtx, insn);
+ push_dep = 1;
+
+ /* CPUs contain special hardware to allow two pushes. */
+ if (push && push_dep)
+ return 0;
+
+ /* Push operation implicitly change stack pointer causing AGI stalls. */
+ if (push_dep && reg_mentioned_in_mem (stack_pointer_rtx, insn))
+ return 1;
+
+ /* Push also implicitly read stack pointer. */
+ if (push && modified_in_p (stack_pointer_rtx, dep_insn))
+ return 1;
return 0;
}