summaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorm.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-15 01:52:49 +0000
committerm.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4>1999-03-15 01:52:49 +0000
commitc4f0a53035ea9672ce2611d89a28f5b54239ae2e (patch)
tree7fe0df0111a98b6f7af1daa0cbded32b22f3ac51 /gcc/rtlanal.c
parentfced1589e930ecde3f94e1284c0211ca5ddc1bba (diff)
downloadgcc-c4f0a53035ea9672ce2611d89a28f5b54239ae2e.tar.gz
* rtlanal.c (auto_inc_p): New function.
* rtl.h (auto_inc_p): Prototype it. * reload1.c (add_auto_inc_notes): New function. (reload): Strip REG_INC notes and call add_auto_inc_notes for each insn to restore them correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25774 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index d061273a172..8347849c6e1 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -2235,3 +2235,27 @@ regno_use_in (regno, x)
return NULL_RTX;
}
+
+
+/* Return 1 if X is an autoincrement side effect and the register is
+ not the stack pointer. */
+int
+auto_inc_p (x)
+ rtx x;
+{
+ switch (GET_CODE (x))
+ {
+ case PRE_INC:
+ case POST_INC:
+ case PRE_DEC:
+ case POST_DEC:
+ case PRE_MODIFY:
+ case POST_MODIFY:
+ /* There are no REG_INC notes for SP. */
+ if (XEXP (x, 0) != stack_pointer_rtx)
+ return 1;
+ default:
+ break;
+ }
+ return 0;
+}