This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Another flow fix


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.


r~


	* 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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]