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]
Other format: [Raw text]

[vtab and trunk] fix gcse for insn before note at end of BB


If an insn is followed by notes before the end of a basic block, gcse
will refrain from inserting the sets in it into the hash table.
There's no reason to do that.  I believe it was just a logic mistake,
that may have never hit before.

Bootstrapped on x86_64-linux-gnu.  Ok to install?

Index: gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* gcse.c (hash_scan_set): Insert set in insn before note at
	the end of basic block.

Index: gcc/gcse.c
===================================================================
--- gcc/gcse.c.orig	2007-08-23 08:26:43.000000000 -0300
+++ gcc/gcse.c	2007-08-23 08:26:48.000000000 -0300
@@ -1760,8 +1760,8 @@ hash_scan_set (rtx pat, rtx insn, struct
 		  modified.  Here we want to search from INSN+1 on, but
 		  oprs_available_p searches from INSN on.  */
 	       && (insn == BB_END (BLOCK_FOR_INSN (insn))
-		   || ((tmp = next_nonnote_insn (insn)) != NULL_RTX
-		       && oprs_available_p (pat, tmp))))
+		   || (tmp = next_nonnote_insn (insn)) == NULL_RTX
+		   || oprs_available_p (pat, tmp)))
 	insert_set_in_table (pat, insn, table);
     }
   /* In case of store we want to consider the memory value as available in
-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
FSF Latin America Board Member         http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

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