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.

Oops, posted the previous message too early.  If only I'd hit `enter'
in the cvsdiff command *before* sending the e-mail :-/

Here's what I meant to post, for real this time.  Apologies for the
noise.

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

	* config/frv/frv.c (frv_ifcvt_modify_insn): Don't leave alone
	scratch insns of the then branch that clobber regs needed by the
	else branch.

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 18 Dec 2003 04:19:45 -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]