Commit 9f16e871 by Jan Hubicka Committed by Jan Hubicka

cfgcleanup.c: Include tm_p.h

	* cfgcleanup.c: Include tm_p.h
	(mark_effect): Fix handling of hard register; fix handling of SET

From-SVN: r48553
parent 302d2f14
Sat Jan 5 01:35:29 CET 2002 Jan Hubicka <jh@suse.cz>
* cfgcleanup.c: Include tm_p.h
(mark_effect): Fix handling of hard register; fix handling of SET
2002-01-04 Kazu Hirata <kazu@hxi.com> 2002-01-04 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300.md (anonymous patterns): Check that * config/h8300/h8300.md (anonymous patterns): Check that
......
...@@ -1477,7 +1477,7 @@ cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \ ...@@ -1477,7 +1477,7 @@ cfgbuild.o : cfgbuild.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h insn-config.h \
function.h except.h $(GGC_H) function.h except.h $(GGC_H)
cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TIMEVAR_H)\ cfgcleanup.o : cfgcleanup.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TIMEVAR_H)\
$(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h $(RECOG_H) toplev.h \ $(BASIC_BLOCK_H) hard-reg-set.h output.h flags.h $(RECOG_H) toplev.h \
$(GGC_H) insn-config.h cselib.h $(GGC_H) insn-config.h cselib.h $(TM_P_H)
cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(BASIC_BLOCK_H) hard-reg-set.h
dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h \ dominance.o : dominance.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) hard-reg-set.h \
......
...@@ -43,6 +43,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -43,6 +43,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "recog.h" #include "recog.h"
#include "toplev.h" #include "toplev.h"
#include "cselib.h" #include "cselib.h"
#include "tm_p.h"
#include "obstack.h" #include "obstack.h"
...@@ -192,21 +193,43 @@ mark_effect (exp, nonequal) ...@@ -192,21 +193,43 @@ mark_effect (exp, nonequal)
rtx exp; rtx exp;
regset nonequal; regset nonequal;
{ {
int regno;
rtx dest;
switch (GET_CODE (exp)) switch (GET_CODE (exp))
{ {
/* In case we do clobber the register, mark it as equal, as we know the /* In case we do clobber the register, mark it as equal, as we know the
value is dead so it don't have to match. */ value is dead so it don't have to match. */
case CLOBBER: case CLOBBER:
if (REG_P (XEXP (exp, 0))) if (REG_P (XEXP (exp, 0)))
CLEAR_REGNO_REG_SET (nonequal, REGNO (XEXP (exp, 0))); {
dest = XEXP (exp, 0);
regno = REGNO (dest);
CLEAR_REGNO_REG_SET (nonequal, regno);
if (regno < FIRST_PSEUDO_REGISTER)
{
int n = HARD_REGNO_NREGS (regno, GET_MODE (dest));
while (--n > 0)
CLEAR_REGNO_REG_SET (nonequal, regno + n);
}
}
return false; return false;
case SET: case SET:
if (rtx_equal_for_cselib_p (SET_DEST (exp), SET_SRC (exp))) if (rtx_equal_for_cselib_p (SET_DEST (exp), SET_SRC (exp)))
return false; return false;
if (GET_CODE (SET_SRC (exp)) != REG) dest = SET_DEST (exp);
if (dest == pc_rtx)
return false;
if (!REG_P (dest))
return true; return true;
SET_REGNO_REG_SET (nonequal, REGNO (SET_SRC (exp))); regno = REGNO (dest);
SET_REGNO_REG_SET (nonequal, regno);
if (regno < FIRST_PSEUDO_REGISTER)
{
int n = HARD_REGNO_NREGS (regno, GET_MODE (dest));
while (--n > 0)
SET_REGNO_REG_SET (nonequal, regno + n);
}
return false; return false;
default: default:
...@@ -292,7 +315,7 @@ thread_jump (mode, e, b) ...@@ -292,7 +315,7 @@ thread_jump (mode, e, b)
processing as if it were same basic block. processing as if it were same basic block.
Our goal is to prove that whole block is an NOOP. */ Our goal is to prove that whole block is an NOOP. */
for (insn = NEXT_INSN (b->head); insn != b->end && !failed; for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end) && !failed;
insn = NEXT_INSN (insn)) insn = NEXT_INSN (insn))
{ {
if (INSN_P (insn)) if (INSN_P (insn))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment