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]

Re: FRV-specific ifcvt bug


On Dec 17, 2003, Richard Henderson <rth@redhat.com> wrote:

> On Wed, Dec 17, 2003 at 01:43:00PM -0200, Alexandre Oliva wrote:
>> * config/frv/frv.c (insn_in_bb_p): Remove.
>> (frv_ifcvt_modify_insn): Simplify previous change.

> Patch is ok, but changelog is wrong for mainline.

Ugh.  Thanks for pointing it out that I managed to turn my
embarrassing stupidity leak into public knowledge :-)

Here's the ChangeLog I meant to post, with the final patch, for the
record:

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

	* config/frv/frv.c (insn_in_bb_p): Remove.
	(frv_ifcvt_modify_insn): Simplify previous change.

Index: gcc/config/frv/frv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv.c,v
retrieving revision 1.41
diff -u -p -r1.41 frv.c
--- gcc/config/frv/frv.c 13 Dec 2003 04:44:05 -0000 1.41
+++ gcc/config/frv/frv.c 17 Dec 2003 15:35:16 -0000
@@ -6942,7 +6942,7 @@ single_set_pattern (rtx pattern)
    insn cannot be converted to be executed conditionally.  */
 
 rtx
-frv_ifcvt_modify_insn (ce_if_block_t *ce_info ATTRIBUTE_UNUSED,
+frv_ifcvt_modify_insn (ce_if_block_t *ce_info,
                        rtx pattern,
                        rtx insn)
 {
@@ -7068,7 +7068,16 @@ frv_ifcvt_modify_insn (ce_if_block_t *ce
          other registers.  */
       else if (frv_ifcvt.scratch_insns_bitmap
 	       && bitmap_bit_p (frv_ifcvt.scratch_insns_bitmap,
-				INSN_UID (insn)))
+				INSN_UID (insn))
+	       /* We must not unconditionally set a reg set used as
+		  scratch in the THEN branch if the same reg is live
+		  in the ELSE branch.  */
+	       && REG_P (SET_DEST (set))
+	       && (! ce_info->else_bb
+		   || BLOCK_FOR_INSN (insn) == ce_info->else_bb
+		   || ! (REGNO_REG_SET_P
+			 (ce_info->else_bb->global_live_at_start,
+			  REGNO (SET_DEST (set))))))
 	pattern = set;
 
       else if (mode == QImode || mode == HImode || mode == SImode
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

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