public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* PARALLEL handling in update_flow_info
@ 1997-08-28 23:41 Joern Rennecke
  1997-09-05 12:39 ` Jeffrey A Law
  0 siblings, 1 reply; 2+ messages in thread
From: Joern Rennecke @ 1997-08-28 23:41 UTC (permalink / raw)
  To: egcs

When compiling _fixunsdfdi for SH little endian (using -O2), this insn:

(insn/v 187 305 188 (parallel[ 
            (set (reg/v:DI 8 r8)
                (minus:DI (reg/v:DI 8 r8)
                    (reg:DI 1 r1)))
            (clobber (reg:SI 18 t))
        ] ) 19 {subdi3} (insn_list 186 (nil))
    (expr_list:REG_DEAD (reg:DI 1 r1)
        (expr_list:REG_UNUSED (reg:SI 18 t)
            (expr_list:REG_DEAD (reg:SI 2 r2)
                (nil)))))

is split in sched2 to:

(insn 303 186 304 (set (reg:SI 18 t)
        (const_int 0)) -1 (nil)
    (nil))

(insn 304 303 305 (parallel[ 
            (set (reg:SI 8 r8)
                (minus:SI (minus:SI (reg:SI 8 r8)
                        (reg:SI 1 r1))
                    (reg:SI 18 t)))
            (set (reg:SI 18 t)
                (gtu:SI (minus:SI (reg:SI 8 r8)
                        (reg:SI 1 r1))
                    (reg:SI 8 r8)))
        ] ) -1 (nil)
    (expr_list:REG_DEAD (reg:SI 1 r1)
        (nil)))

(insn 305 304 188 (parallel[ 
            (set (reg:SI 9 r9)
                (minus:SI (minus:SI (reg:SI 9 r9)
                        (reg:SI 2 r2))
                    (reg:SI 18 t)))
            (clobber (reg:SI 18 t))
        ] ) -1 (nil)
    (expr_list:REG_UNUSED (reg:SI 18 t)
        (expr_list:REG_DEAD (reg:SI 2 r2)
            (nil))))

and then update_flow_info panics:

      else if (! found_orig_dest)
        {
          /* This should never happen.  */
          abort ();
        }

This is because the search for orig_dest and split_dest uses single_set,
which does not work for insn 304, which has two sets.

Here is a patch to fix this problem:

Sat Aug 16 20:57:20 1997  J"orn Rennecke <amylaar@cygnus.co.uk>

	* sched.c (update_flow_info) When looking if to set found_split_dest
	or found_orig_dest, look at all parts of a PARALLEL.

*** sched.c-970803	Wed Aug 13 21:01:42 1997
--- sched.c	Fri Aug 29 00:18:59 1997
*************** update_flow_info (notes, first, last, or
*** 4670,4690 ****
  
        for (insn = first; ; insn = NEXT_INSN (insn))
  	{
! 	  set = single_set (insn);
! 	  if (set)
  	    {
! 	      if (GET_CODE (SET_DEST (set)) == REG
! 		  && REGNO (SET_DEST (set)) == REGNO (orig_dest))
  		{
! 		  found_orig_dest = 1;
! 		  break;
! 		}
! 	      else if (GET_CODE (SET_DEST (set)) == SUBREG
! 		       && SUBREG_REG (SET_DEST (set)) == orig_dest)
! 		{
! 		  found_split_dest = 1;
! 		  break;
  		}
  	    }
  
  	  if (insn == last)
--- 4670,4698 ----
  
        for (insn = first; ; insn = NEXT_INSN (insn))
  	{
! 	  rtx pat = PATTERN (insn);
! 	  int i = GET_CODE (pat) == PARALLEL ? XVECLEN (pat, 0) : 0;
! 	  set = pat;
! 	  for (;;)
  	    {
! 	      if (GET_CODE (set) == SET)
  		{
! 		  if (GET_CODE (SET_DEST (set)) == REG
! 		      && REGNO (SET_DEST (set)) == REGNO (orig_dest))
! 		    {
! 		      found_orig_dest = 1;
! 		      break;
! 		    }
! 		  else if (GET_CODE (SET_DEST (set)) == SUBREG
! 			   && SUBREG_REG (SET_DEST (set)) == orig_dest)
! 		    {
! 		      found_split_dest = 1;
! 		      break;
! 		    }
  		}
+ 	      if (--i < 0)
+ 		break;
+ 	      set = XVECEXP (pat, 0, i);
  	    }
  
  	  if (insn == last)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PARALLEL handling in update_flow_info
  1997-08-28 23:41 PARALLEL handling in update_flow_info Joern Rennecke
@ 1997-09-05 12:39 ` Jeffrey A Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeffrey A Law @ 1997-09-05 12:39 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: egcs

  In message <199708282329.AAA21381@phal.cygnus.co.uk>you write:
  > Sat Aug 16 20:57:20 1997  J"orn Rennecke <amylaar@cygnus.co.uk>
  > 
  > 	* sched.c (update_flow_info) When looking if to set found_split_dest
  > 	or found_orig_dest, look at all parts of a PARALLEL.
Thanks.  I've installed a slightly modified version into egcs.

Basically I couldn't convince myself that "insn" would always be an 
INSN, so it verifies that the class is correct before try to 
do anything with it.

jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-09-05 12:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-08-28 23:41 PARALLEL handling in update_flow_info Joern Rennecke
1997-09-05 12:39 ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).