[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-patches
Subject:    [patch committed] SH: Fix -fcompare-debug failure for pr42685.c
From:       Kaz Kojima <kkojima () rr ! iij4u ! or ! jp>
Date:       2010-02-28 23:25:30
Message-ID: 20100301.082530.175584698.kkojima () rr ! iij4u ! or ! jp
[Download RAW message or body]

Hi,

Two test recently added

  g++.dg/other/pr42685.C (test for excess errors)
  gcc.dg/pr42685.c (test for excess errors)

fail for SH with -fcompare-debug error.  -save-temps shows
that .gk.gkd differs with .gkd at stuff_delay_slot and
block_branch_redirect fake insns.  These insns use some
INSN_UIDs for the argument of the UNSPEC_BBR unspec insn and
those INSN_UIDs are changed with -g.  The attached patch uses
a static counter instead of INSN_UID for that purpose.
I've confirmed that both patched/unpatched compilers produce
same codes on all CSiBE tests and there is no new failures
with bootstrap and the top level "make -k check" on
sh4-unknown-linux-gnu.  Committed on trunk.

Regards,
	kaz
--
2010-02-28  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/sh.c (unspec_bbr_uid): New.
	(gen_block_redirect): Use it instead of INSN_UID.
	(gen_far_branch): Likewise.

--- ORIG/trunk/gcc/config/sh/sh.c	2010-02-12 11:07:38.000000000 +0900
+++ trunk/gcc/config/sh/sh.c	2010-02-27 09:30:54.000000000 +0900
@@ -107,6 +107,9 @@ static int skip_cycles = 0;
    and returned from sh_reorder2.  */
 static short cached_can_issue_more;
 
+/* Unique number for UNSPEC_BBR pattern.  */
+static unsigned int unspec_bbr_uid = 1;
+
 /* Provides the class number of the smallest class containing
    reg number.  */
 
@@ -5012,8 +5015,8 @@ gen_block_redirect (rtx jump, int addr, 
 	 branch; simplejump_p fails for indirect jumps even if they have
 	 a JUMP_LABEL.  */
       rtx insn = emit_insn_before (gen_indirect_jump_scratch
-				   (reg, GEN_INT (INSN_UID (JUMP_LABEL (jump))))
-				   , jump);
+				   (reg, GEN_INT (unspec_bbr_uid++)),
+				   jump);
       /* ??? We would like this to have the scope of the jump, but that
 	 scope will change when a delay slot insn of an inner scope is added.
 	 Hence, after delay slot scheduling, we'll have to expect
@@ -5028,8 +5031,8 @@ gen_block_redirect (rtx jump, int addr, 
     /* We can't use JUMP_LABEL here because it might be undefined
        when not optimizing.  */
     return emit_insn_before (gen_block_branch_redirect
-		      (GEN_INT (INSN_UID (XEXP (SET_SRC (PATTERN (jump)), 0))))
-		      , jump);
+			     (GEN_INT (unspec_bbr_uid++)),
+			     jump);
   return prev;
 }
 
@@ -5088,7 +5091,7 @@ gen_far_branch (struct far_branch *bp)
   if (bp->far_label)
     (emit_insn_after
      (gen_stuff_delay_slot
-      (GEN_INT (INSN_UID (XEXP (SET_SRC (PATTERN (jump)), 0))),
+      (GEN_INT (unspec_bbr_uid++),
        GEN_INT (recog_memoized (insn) == CODE_FOR_branch_false)),
       insn));
   /* Prevent reorg from undoing our splits.  */
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic