This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Another flow fix
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: [PATCH] Another flow fix
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 5 May 2000 18:01:57 +0200
- Cc: gcc-patches at gcc dot gnu dot org, "David S. Miller" <davem at redhat dot com>
- References: <20000504110258.N540@sunsite.ms.mff.cuni.cz> <20000504164931.B16780@cygnus.com>
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
On Thu, May 04, 2000 at 04:49:31PM -0700, Richard Henderson wrote:
> On Thu, May 04, 2000 at 11:02:58AM +0200, Jakub Jelinek wrote:
> > This patchlet fixes the following ICE on sparc64:
> >
> > typedef struct { unsigned int a; } foo;
> > foo baz(unsigned int);
> > foo bar(unsigned int dst)
> > {
> > foo k = baz(dst);
> > return k;
> > }
>
> I think the proper fix is to reg_overlap_mentioned_p. Dave's
> original code for this was not aggressive enough.
This works well. Can you commit it?
>
> * rtlanal.c (reg_overlap_mentioned_p): Treat parallels in the
> same way emit_group_load does.
>
> Index: rtlanal.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/rtlanal.c,v
> retrieving revision 1.59
> diff -c -p -d -r1.59 rtlanal.c
> *** rtlanal.c 2000/05/03 18:06:26 1.59
> --- rtlanal.c 2000/05/04 23:44:03
> *************** reg_overlap_mentioned_p (x, in)
> *** 992,1008 ****
> return reg_mentioned_p (x, in);
>
> case PARALLEL:
> ! if (GET_MODE (x) == BLKmode)
> ! {
> ! register int i;
>
> ! /* If any register in here refers to it we return true. */
> ! for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
> ! if (reg_overlap_mentioned_p (SET_DEST (XVECEXP (x, 0, i)), in))
> ! return 1;
> ! return 0;
> ! }
> ! break;
>
> default:
> break;
> --- 992,1013 ----
> return reg_mentioned_p (x, in);
>
> case PARALLEL:
> ! {
> ! int i, n;
>
> ! /* Check for a NULL entry, used to indicate that the parameter goes
> ! both on the stack and in registers. */
> ! if (XEXP (XVECEXP (x, 0, 0), 0))
> ! i = 0;
> ! else
> ! i = 1;
> !
> ! /* If any register in here refers to it we return true. */
> ! for (n = XVECLEN (x, 0); i < n; ++i)
> ! if (reg_overlap_mentioned_p (XEXP (XVECEXP (x, 0, i), 0), in))
> ! return 1;
> ! return 0;
> ! }
>
> default:
> break;
Jakub