public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* cse.c bug?
@ 1998-02-01 12:59 John Carr
  1998-02-09  2:36 ` Jeffrey A Law
  0 siblings, 1 reply; 2+ messages in thread
From: John Carr @ 1998-02-01 12:59 UTC (permalink / raw)
  To: egcs

I think there is a bug in the CSE code to scan skipped blocks.  It's
been about 5 years since I worked on this code and I can't remember
why invalidate_skipped_set ignores CLOBBERs, but I found a case where
it shouldn't.

On SPARC, in a sequence like
	set cc
	branch on cc
	label
	clobber cc
	set cc
	branch on cc

the second compare was being eliminated even though the CC was no
longer valid.  The clobber was in a PARALLEL.

Can anyone see where CLOBBER in a skipped block is supposed to be
handled?  If not, I suggest this patch.


Sun Feb  1 15:26:40 1998  John Carr  <jfc@mit.edu>

	* cse.c (invalidate_skipped_set): Don't ignore CLOBBERs.

*** cse.c~	Sun Feb  1 10:36:11 1998
--- cse.c	Sun Feb  1 15:25:25 1998
***************
*** 7844,7851 ****
      }
  }
  \f
! /* Process one SET of an insn that was skipped.  We ignore CLOBBERs
!    since they are done elsewhere.  This function is called via note_stores.  */
  
  static void
  invalidate_skipped_set (dest, set)
--- 7844,7851 ----
      }
  }
  \f
! /* Process one SET of an insn that was skipped.  This function is called
!    via note_stores.  */
  
  static void
  invalidate_skipped_set (dest, set)
***************
*** 7868,7878 ****
        return;
      }
  
!   if (GET_CODE (set) == CLOBBER
  #ifdef HAVE_cc0
        || dest == cc0_rtx
  #endif
!       || dest == pc_rtx)
      return;
  
    if (code == STRICT_LOW_PART || code == ZERO_EXTRACT)
--- 7868,7878 ----
        return;
      }
  
!   if (dest == pc_rtx
  #ifdef HAVE_cc0
        || dest == cc0_rtx
  #endif
!       )
      return;
  
    if (code == STRICT_LOW_PART || code == ZERO_EXTRACT)

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

* Re: cse.c bug?
  1998-02-01 12:59 cse.c bug? John Carr
@ 1998-02-09  2:36 ` Jeffrey A Law
  0 siblings, 0 replies; 2+ messages in thread
From: Jeffrey A Law @ 1998-02-09  2:36 UTC (permalink / raw)
  To: John Carr; +Cc: egcs

  In message < 199802012043.PAA13035@jfc. >you write:
  > 
  > I think there is a bug in the CSE code to scan skipped blocks.  It's
  > been about 5 years since I worked on this code and I can't remember
  > why invalidate_skipped_set ignores CLOBBERs, but I found a case where
  > it shouldn't.
  > 
  > On SPARC, in a sequence like
  > 	set cc
  > 	branch on cc
  > 	label
  > 	clobber cc
  > 	set cc
  > 	branch on cc
  > 
  > the second compare was being eliminated even though the CC was no
  > longer valid.  The clobber was in a PARALLEL.
  > 
  > Can anyone see where CLOBBER in a skipped block is supposed to be
  > handled?  If not, I suggest this patch.
Hmmm, your alias analysis changes removed a call to invalidate_from_clobbers:

        note_stores (PATTERN (insn), invalidate_skipped_set);
-       invalidate_from_clobbers (&skipped_writes_memory, PATTERN (insn));

Which might be the problem.  You might just need to add the call back
(without the skipped_writes_memory argument).

jeff

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

end of thread, other threads:[~1998-02-09  2:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-01 12:59 cse.c bug? John Carr
1998-02-09  2:36 ` 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).