public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix latent bug in RTL GCSE/PRE (PR57159)
@ 2013-05-03 13:10 Julian Brown
  2013-05-05 10:19 ` Steven Bosscher
  2013-05-06 17:53 ` Jeff Law
  0 siblings, 2 replies; 9+ messages in thread
From: Julian Brown @ 2013-05-03 13:10 UTC (permalink / raw)
  To: gcc-patches; +Cc: Steven Bosscher

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

Hi,

This is a patch which fixes a latent bug in RTL GCSE/PRE, described
more fully in:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57159

I haven't been able to reproduce the problem on mainline (nor on a
supported target). Maybe someone more familiar with the code in question
than I am can tell if the patch is correct nonetheless?

Thanks,

Julian

ChangeLog

    gcc/
    * gcse.c (compute_ld_motion_mems): Invalidate non-simple mem refs
    in REG_EQUAL notes.

[-- Attachment #2: pre-bugfix-1.diff --]
[-- Type: text/x-patch, Size: 1082 bytes --]

Index: gcc/gcse.c
===================================================================
--- gcc/gcse.c	(revision 198175)
+++ gcc/gcse.c	(working copy)
@@ -3888,6 +3888,13 @@ compute_ld_motion_mems (void)
 		{
 		  rtx src = SET_SRC (PATTERN (insn));
 		  rtx dest = SET_DEST (PATTERN (insn));
+		  rtx note = find_reg_equal_equiv_note (insn);
+		  rtx src_eq;
+
+		  if (note != 0 && REG_NOTE_KIND (note) == REG_EQUAL)
+		    src_eq = XEXP (note, 0);
+		  else
+		    src_eq = NULL_RTX;
 
 		  /* Check for a simple LOAD...  */
 		  if (MEM_P (src) && simple_mem (src))
@@ -3904,6 +3911,12 @@ compute_ld_motion_mems (void)
 		      invalidate_any_buried_refs (src);
 		    }
 
+		  /* Also invalidate any buried loads which may be present in
+		     REG_EQUAL notes.  */
+		  if (src_eq != NULL_RTX
+		      && !(MEM_P (src_eq) && simple_mem (src_eq)))
+		    invalidate_any_buried_refs (src_eq);
+
 		  /* Check for stores. Don't worry about aliased ones, they
 		     will block any movement we might do later. We only care
 		     about this exact pattern since those are the only

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

end of thread, other threads:[~2013-05-18  3:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-03 13:10 [PATCH] Fix latent bug in RTL GCSE/PRE (PR57159) Julian Brown
2013-05-05 10:19 ` Steven Bosscher
2013-05-06 15:28   ` Jeff Law
2013-05-06 16:28     ` Steven Bosscher
2013-05-06 17:45       ` Jeff Law
2013-05-06 17:53 ` Jeff Law
2013-05-07 15:06   ` Julian Brown
2013-05-15 13:29     ` Julian Brown
2013-05-18  3:53     ` Jeff 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).