Commit b5ee7789 by Catherine Moore Committed by Catherine Moore

Makefile.in (genattrtab): Don't use (HOST_RTLANAL).

        * Makefile.in (genattrtab): Don't use (HOST_RTLANAL).
        * rtl.h (rtx_equal_p): Move prototype.
        * rtl.c (rtx_equal_function_value_matters): Move from
        rtlanal.c
        (rtx_equal_p): Likewise.
        * rtlanal.c (rtx_equal_function_value_matters): Delete.
        (rtx_equal_p): Likewise.

From-SVN: r30350
parent 96e9c98d
Tue Nov 2 09:43:00 1999 Catherine Moore <clm@cygnus.com>
* Makefile.in (genattrtab): Don't use (HOST_RTLANAL).
* rtl.h (rtx_equal_p): Move prototype.
* rtl.c (rtx_equal_function_value_matters): Move from
rtlanal.c
(rtx_equal_p): Likewise.
* rtlanal.c (rtx_equal_function_value_matters): Delete.
(rtx_equal_p): Likewise.
Mon Nov 1 23:21:17 1999 Jason Merrill <jason@yorick.cygnus.com> Mon Nov 1 23:21:17 1999 Jason Merrill <jason@yorick.cygnus.com>
* libgcc2.c (__do_global_dtors): Only do EH frame stuff if * libgcc2.c (__do_global_dtors): Only do EH frame stuff if
......
...@@ -571,7 +571,6 @@ HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \ ...@@ -571,7 +571,6 @@ HOST_LIBS = $(USE_HOST_OBSTACK) $(USE_HOST_ALLOCA) $(USE_HOST_MALLOC) \
$(HOST_CLIB) $(HOST_CLIB)
HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o $(HOST_PREFIX)ggc-none.o HOST_RTL = $(HOST_PREFIX)rtl.o $(HOST_PREFIX)bitmap.o $(HOST_PREFIX)ggc-none.o
HOST_RTLANAL = $(HOST_PREFIX)rtlanal.o
HOST_PRINT = $(HOST_PREFIX)print-rtl.o HOST_PRINT = $(HOST_PREFIX)print-rtl.o
HOST_ERRORS = $(HOST_PREFIX)errors.o HOST_ERRORS = $(HOST_PREFIX)errors.o
...@@ -1844,9 +1843,9 @@ genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS) ...@@ -1844,9 +1843,9 @@ genattr : genattr.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h errors.h genattr.o : genattr.c $(RTL_H) $(build_xm_file) system.h errors.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattr.c
genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_RTLANAL) $(HOST_LIBDEPS) genattrtab : genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBDEPS)
$(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \ $(HOST_CC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -o $@ \
genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_RTLANAL) $(HOST_LIBS) genattrtab.o $(HOST_RTL) $(HOST_PRINT) $(HOST_ERRORS) $(HOST_LIBS)
genattrtab.o : genattrtab.c $(RTL_H) $(build_xm_file) system.h errors.h ggc.h genattrtab.o : genattrtab.c $(RTL_H) $(build_xm_file) system.h errors.h ggc.h
$(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c $(HOST_CC) -c $(HOST_CFLAGS) $(HOST_CPPFLAGS) $(INCLUDES) $(srcdir)/genattrtab.c
......
...@@ -582,6 +582,114 @@ shallow_copy_rtx (orig) ...@@ -582,6 +582,114 @@ shallow_copy_rtx (orig)
return copy; return copy;
} }
/* This is 1 until after the rtl generation pass. */
int rtx_equal_function_value_matters;
/* Return 1 if X and Y are identical-looking rtx's.
This is the Lisp function EQUAL for rtx arguments. */
int
rtx_equal_p (x, y)
rtx x, y;
{
register int i;
register int j;
register enum rtx_code code;
register const char *fmt;
if (x == y)
return 1;
if (x == 0 || y == 0)
return 0;
code = GET_CODE (x);
/* Rtx's of different codes cannot be equal. */
if (code != GET_CODE (y))
return 0;
/* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent.
(REG:SI x) and (REG:HI x) are NOT equivalent. */
if (GET_MODE (x) != GET_MODE (y))
return 0;
/* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */
if (code == REG)
/* Until rtl generation is complete, don't consider a reference to the
return register of the current function the same as the return from a
called function. This eases the job of function integration. Once the
distinction is no longer needed, they can be considered equivalent. */
return (REGNO (x) == REGNO (y)
&& (! rtx_equal_function_value_matters
|| REG_FUNCTION_VALUE_P (x) == REG_FUNCTION_VALUE_P (y)));
else if (code == LABEL_REF)
return XEXP (x, 0) == XEXP (y, 0);
else if (code == SYMBOL_REF)
return XSTR (x, 0) == XSTR (y, 0);
else if (code == SCRATCH || code == CONST_DOUBLE)
return 0;
/* Compare the elements. If any pair of corresponding elements
fail to match, return 0 for the whole things. */
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
switch (fmt[i])
{
case 'w':
if (XWINT (x, i) != XWINT (y, i))
return 0;
break;
case 'n':
case 'i':
if (XINT (x, i) != XINT (y, i))
return 0;
break;
case 'V':
case 'E':
/* Two vectors must have the same length. */
if (XVECLEN (x, i) != XVECLEN (y, i))
return 0;
/* And the corresponding elements must match. */
for (j = 0; j < XVECLEN (x, i); j++)
if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0)
return 0;
break;
case 'e':
if (rtx_equal_p (XEXP (x, i), XEXP (y, i)) == 0)
return 0;
break;
case 'S':
case 's':
if (strcmp (XSTR (x, i), XSTR (y, i)))
return 0;
break;
case 'u':
/* These are just backpointers, so they don't matter. */
break;
case '0':
case 't':
break;
/* It is believed that rtx's at this level will never
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
default:
abort ();
}
}
return 1;
}
/* Subroutines of read_rtx. */ /* Subroutines of read_rtx. */
/* The current line number for the file. */ /* The current line number for the file. */
......
...@@ -973,6 +973,7 @@ extern rtx copy_rtx PROTO((rtx)); ...@@ -973,6 +973,7 @@ extern rtx copy_rtx PROTO((rtx));
extern rtx copy_rtx_if_shared PROTO((rtx)); extern rtx copy_rtx_if_shared PROTO((rtx));
extern rtx copy_most_rtx PROTO((rtx, rtx)); extern rtx copy_most_rtx PROTO((rtx, rtx));
extern rtx shallow_copy_rtx PROTO((rtx)); extern rtx shallow_copy_rtx PROTO((rtx));
extern int rtx_equal_p PROTO((rtx, rtx));
extern rtvec gen_rtvec_v PROTO((int, rtx *)); extern rtvec gen_rtvec_v PROTO((int, rtx *));
extern rtx gen_reg_rtx PROTO((enum machine_mode)); extern rtx gen_reg_rtx PROTO((enum machine_mode));
extern rtx gen_label_rtx PROTO((void)); extern rtx gen_label_rtx PROTO((void));
...@@ -1109,7 +1110,6 @@ extern int refers_to_regno_p PROTO((int, int, rtx, rtx *)); ...@@ -1109,7 +1110,6 @@ extern int refers_to_regno_p PROTO((int, int, rtx, rtx *));
extern int reg_overlap_mentioned_p PROTO((rtx, rtx)); extern int reg_overlap_mentioned_p PROTO((rtx, rtx));
extern void note_stores PROTO((rtx, void (*)(rtx, rtx, void *), void *)); extern void note_stores PROTO((rtx, void (*)(rtx, rtx, void *), void *));
extern rtx reg_set_last PROTO((rtx, rtx)); extern rtx reg_set_last PROTO((rtx, rtx));
extern int rtx_equal_p PROTO((rtx, rtx));
extern int dead_or_set_p PROTO((rtx, rtx)); extern int dead_or_set_p PROTO((rtx, rtx));
extern int dead_or_set_regno_p PROTO((rtx, int)); extern int dead_or_set_regno_p PROTO((rtx, int));
extern rtx find_reg_note PROTO((rtx, enum reg_note, rtx)); extern rtx find_reg_note PROTO((rtx, enum reg_note, rtx));
......
...@@ -1069,114 +1069,6 @@ reg_set_last (x, insn) ...@@ -1069,114 +1069,6 @@ reg_set_last (x, insn)
return 0; return 0;
} }
/* This is 1 until after the rtl generation pass. */
int rtx_equal_function_value_matters;
/* Return 1 if X and Y are identical-looking rtx's.
This is the Lisp function EQUAL for rtx arguments. */
int
rtx_equal_p (x, y)
rtx x, y;
{
register int i;
register int j;
register enum rtx_code code;
register const char *fmt;
if (x == y)
return 1;
if (x == 0 || y == 0)
return 0;
code = GET_CODE (x);
/* Rtx's of different codes cannot be equal. */
if (code != GET_CODE (y))
return 0;
/* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent.
(REG:SI x) and (REG:HI x) are NOT equivalent. */
if (GET_MODE (x) != GET_MODE (y))
return 0;
/* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */
if (code == REG)
/* Until rtl generation is complete, don't consider a reference to the
return register of the current function the same as the return from a
called function. This eases the job of function integration. Once the
distinction is no longer needed, they can be considered equivalent. */
return (REGNO (x) == REGNO (y)
&& (! rtx_equal_function_value_matters
|| REG_FUNCTION_VALUE_P (x) == REG_FUNCTION_VALUE_P (y)));
else if (code == LABEL_REF)
return XEXP (x, 0) == XEXP (y, 0);
else if (code == SYMBOL_REF)
return XSTR (x, 0) == XSTR (y, 0);
else if (code == SCRATCH || code == CONST_DOUBLE)
return 0;
/* Compare the elements. If any pair of corresponding elements
fail to match, return 0 for the whole things. */
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
switch (fmt[i])
{
case 'w':
if (XWINT (x, i) != XWINT (y, i))
return 0;
break;
case 'n':
case 'i':
if (XINT (x, i) != XINT (y, i))
return 0;
break;
case 'V':
case 'E':
/* Two vectors must have the same length. */
if (XVECLEN (x, i) != XVECLEN (y, i))
return 0;
/* And the corresponding elements must match. */
for (j = 0; j < XVECLEN (x, i); j++)
if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0)
return 0;
break;
case 'e':
if (rtx_equal_p (XEXP (x, i), XEXP (y, i)) == 0)
return 0;
break;
case 'S':
case 's':
if (strcmp (XSTR (x, i), XSTR (y, i)))
return 0;
break;
case 'u':
/* These are just backpointers, so they don't matter. */
break;
case '0':
case 't':
break;
/* It is believed that rtx's at this level will never
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
default:
abort ();
}
}
return 1;
}
/* Call FUN on each register or MEM that is stored into or clobbered by X. /* Call FUN on each register or MEM that is stored into or clobbered by X.
(X would be the pattern of an insn). (X would be the pattern of an insn).
FUN receives two arguments: FUN receives two arguments:
......
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