aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index b890b72..3a26d8f 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -37,6 +37,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include "real.h"
#include "regs.h"
#include "function.h"
+#include "df.h"
#include "tree.h"
/* Information about a subreg of a hard register. */
@@ -619,6 +620,7 @@ count_occurrences (rtx x, rtx find, int count_dest)
}
return count;
}
+
/* Nonzero if register REG appears somewhere within IN.
Also works if REG is not a register; in this case it checks
@@ -1538,7 +1540,7 @@ note_uses (rtx *pbody, void (*fun) (rtx *, void *), void *data)
REG may be a hard or pseudo reg. Renumbering is not taken into account,
but for this use that makes no difference, since regs don't overlap
during their lifetimes. Therefore, this function may be used
- at any time after deaths have been computed (in flow.c).
+ at any time after deaths have been computed.
If REG is a hard reg that occupies multiple machine registers, this
function will only return 1 if each of those registers will be replaced
@@ -1616,8 +1618,7 @@ covers_regno_p (rtx dest, unsigned int test_regno)
return covers_regno_no_parallel_p (dest, test_regno);
}
-/* Utility function for dead_or_set_p to check an individual register. Also
- called from flow.c. */
+/* Utility function for dead_or_set_p to check an individual register. */
int
dead_or_set_regno_p (rtx insn, unsigned int test_regno)
@@ -1872,19 +1873,24 @@ remove_note (rtx insn, rtx note)
return;
if (REG_NOTES (insn) == note)
+ REG_NOTES (insn) = XEXP (note, 1);
+ else
+ for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
+ if (XEXP (link, 1) == note)
+ {
+ XEXP (link, 1) = XEXP (note, 1);
+ break;
+ }
+
+ switch (REG_NOTE_KIND (note))
{
- REG_NOTES (insn) = XEXP (note, 1);
- return;
+ case REG_EQUAL:
+ case REG_EQUIV:
+ df_notes_rescan (insn);
+ break;
+ default:
+ break;
}
-
- for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
- if (XEXP (link, 1) == note)
- {
- XEXP (link, 1) = XEXP (note, 1);
- return;
- }
-
- gcc_unreachable ();
}
/* Remove REG_EQUAL and/or REG_EQUIV notes if INSN has such notes. */
@@ -2888,11 +2894,7 @@ commutative_operand_precedence (rtx op)
if (code == SUBREG && OBJECT_P (SUBREG_REG (op)))
return -2;
- if (!CONSTANT_P (op))
- return 0;
- else
- /* As for RTX_CONST_OBJ. */
- return -3;
+ return 0;
case RTX_OBJ:
/* Complex expressions should be the first, so decrease priority