This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Recent changes to cse.c
- To: Jan Hubicka <jh at suse dot cz>
- Subject: Re: Recent changes to cse.c
- From: Jan Hubicka <jh at suse dot cz>
- Date: Tue, 17 Jul 2001 12:37:26 +0200
- Cc: Richard Henderson <rth at redhat dot com>, Daniel Berlin <dan at cgsoftware dot com>, David Edelsohn <dje at watson dot ibm dot com>, Mike Lerwill <mike at ml-solutions dot co dot uk>, gcc-patches at gcc dot gnu dot org, Mark Mitchell <mark at codesourcery dot com>
- References: <200107170357.XAA28848@makai.watson.ibm.com> <u8y9pom9lw.fsf@gromit.moeb> <87snfw2kbr.fsf@cgsoftware.com> <20010716231745.B11525@redhat.com> <20010717123118.C13425@atrey.karlin.mff.cuni.cz>
> > On Tue, Jul 17, 2001 at 01:31:04AM -0400, Daniel Berlin wrote:
> > > This is caused by Richard Henderson's change.
> >
> > No, it was
> >
> > date: 2001/07/16 20:54:43; author: hubicka; state: Exp; lines: +166 -107
> > * cse.c (set_live_p, insn_live_p, dead_libcall_p): Break out from ...
> > (delete_trivially_dead_insns): ... here; accept new argument
> > preserve_basic_blocks; preserve basic blocks if set.
> Ooops, I apologize for the problem - I didn't tested on cc0 target
> Here is patch that should solve the problem. I am going to install it as obvious
> if MIPS regtesting complettes
>
> Honza
oops again, here comes the patch. It also avoid an unused argument in dead_libcall_p
I originally wanted to use to eliminate the truly dead libcalls, but I need to use
other way.
Tue Jul 17 12:29:02 CEST 2001 Jan Hubicka <jh@suse.cz>
* cse.c (set_live_p): Add argument insn;
(insn_live_p): Update set_live_p call.
(dead_libcall_p): Remove argument count;
(delete_trivially_dead_insns): Update dead_libcall_p call;
kill unused variable.
Index: cse.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cse.c,v
retrieving revision 1.191
diff -c -3 -p -r1.191 cse.c
*** cse.c 2001/07/16 20:54:43 1.191
--- cse.c 2001/07/17 10:28:49
*************** static int check_dependence PARAMS ((rtx
*** 690,697 ****
static void flush_hash_table PARAMS ((void));
static bool insn_live_p PARAMS ((rtx, int *));
! static bool set_live_p PARAMS ((rtx, int *));
! static bool dead_libcall_p PARAMS ((rtx, int *));
/* Dump the expressions in the equivalence class indicated by CLASSP.
This function is used only for debugging. */
--- 690,697 ----
static void flush_hash_table PARAMS ((void));
static bool insn_live_p PARAMS ((rtx, int *));
! static bool set_live_p PARAMS ((rtx, rtx, int *));
! static bool dead_libcall_p PARAMS ((rtx));
/* Dump the expressions in the equivalence class indicated by CLASSP.
This function is used only for debugging. */
*************** count_reg_usage (x, counts, dest, incr)
*** 7486,7492 ****
/* Return true if set is live. */
static bool
! set_live_p (set, counts)
rtx set;
int *counts;
{
--- 7486,7493 ----
/* Return true if set is live. */
static bool
! set_live_p (insn, set, counts)
! rtx insn ATTRIBUTE_UNUSED;
rtx set;
int *counts;
{
*************** insn_live_p (insn, counts)
*** 7527,7533 ****
{
int i;
if (GET_CODE (PATTERN (insn)) == SET)
! return set_live_p (PATTERN (insn), counts);
else if (GET_CODE (PATTERN (insn)) == PARALLEL)
for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--)
{
--- 7528,7534 ----
{
int i;
if (GET_CODE (PATTERN (insn)) == SET)
! return set_live_p (insn, PATTERN (insn), counts);
else if (GET_CODE (PATTERN (insn)) == PARALLEL)
for (i = XVECLEN (PATTERN (insn), 0) - 1; i >= 0; i--)
{
*************** insn_live_p (insn, counts)
*** 7535,7541 ****
if (GET_CODE (elt) == SET)
{
! if (set_live_p (elt, counts))
return true;
}
else if (GET_CODE (elt) != CLOBBER && GET_CODE (elt) != USE)
--- 7536,7542 ----
if (GET_CODE (elt) == SET)
{
! if (set_live_p (insn, elt, counts))
return true;
}
else if (GET_CODE (elt) != CLOBBER && GET_CODE (elt) != USE)
*************** insn_live_p (insn, counts)
*** 7548,7556 ****
/* Return true if libcall is dead as a whole. */
static bool
! dead_libcall_p (insn, counts)
rtx insn;
- int *counts;
{
rtx note;
/* See if there's a REG_EQUAL note on this insn and try to
--- 7549,7556 ----
/* Return true if libcall is dead as a whole. */
static bool
! dead_libcall_p (insn)
rtx insn;
{
rtx note;
/* See if there's a REG_EQUAL note on this insn and try to
*************** delete_trivially_dead_insns (insns, nreg
*** 7616,7622 ****
for (; insn; insn = prev)
{
int live_insn = 0;
- rtx note;
prev = prev_real_insn (insn);
--- 7616,7621 ----
*************** delete_trivially_dead_insns (insns, nreg
*** 7629,7635 ****
{
in_libcall = 1;
live_insn = 1;
! dead_libcall = dead_libcall_p (insn, counts);
}
else if (in_libcall)
live_insn = ! dead_libcall;
--- 7628,7634 ----
{
in_libcall = 1;
live_insn = 1;
! dead_libcall = dead_libcall_p (insn);
}
else if (in_libcall)
live_insn = ! dead_libcall;
*************** delete_trivially_dead_insns (insns, nreg
*** 7656,7662 ****
for (bb = BASIC_BLOCK (i), insn = bb->end; insn != bb->head; insn = prev)
{
int live_insn = 0;
- rtx note;
prev = PREV_INSN (insn);
if (!INSN_P (insn))
--- 7655,7660 ----
*************** delete_trivially_dead_insns (insns, nreg
*** 7671,7677 ****
{
in_libcall = 1;
live_insn = 1;
! dead_libcall = dead_libcall_p (insn, counts);
}
else if (in_libcall)
live_insn = ! dead_libcall;
--- 7669,7675 ----
{
in_libcall = 1;
live_insn = 1;
! dead_libcall = dead_libcall_p (insn);
}
else if (in_libcall)
live_insn = ! dead_libcall;