[dataflow] [patch RFA] Fix build failre on sh64

Kaz Kojima kkojima@rr.iij4u.or.jp
Thu May 24 22:28:00 GMT 2007


Hi,

I've tested sh64 and m32r on the dataflow branch.
m32r-unknown-linux-gnu was built successfully, but sh64
fails to build during compiling libgcc:

../../../ORIG/dataflow/libgcc/../gcc/libgcc2.c: In function '__addvsi3':
../../../ORIG/dataflow/libgcc/../gcc/libgcc2.c:93: internal compiler error: in df_refs_verify, at df-scan.c:4075

In the faulty case, it seems that branch target load optimization
pass replaces an insn

(jump_insn:HI 22 55 23 5 ../../../ORIG/dataflow/libgcc/../gcc/libgcc2.c:89 (set (pc)
        (if_then_else (eq (reg:SI 2 r2 [orig:160 iftmp.25 ] [160])
                (const_int 0 [0x0]))
            (reg:SI 128 tr0)
            (pc))) 213 {*beq_media_i32} (insn_list:REG_LABEL 30 (expr_list:REG_BR_PROB (const_int 9900 [0x26ac])
            (nil))))

with

(jump_insn:HI 22 21 23 5 ../../../ORIG/dataflow/libgcc/../gcc/libgcc2.c:89 (set (pc)
        (if_then_else (eq (reg:SI 2 r2 [orig:160 iftmp.25 ] [160])
                (const_int 0 [0x0]))
            (reg:SI 129 tr1)
            (pc))) 213 {*beq_media_i32} (insn_list:REG_LABEL 30 (expr_list:REG_BR_PROB (const_int 9900 [0x26ac])
            (nil))))

but doesn't update the df information of the resulted insn.  With
the attached patch, sh64-unknown-linux-gnu can be built successfully.
It's also tested with bootstrap and regtested with "make -k check"
for i686-pc-linux-gnu with no new regressions on the dataflow branch.

Regards,
	Caz
--
	* BTW-load.c (move_btr_def): Call df_insn_rescan when changing
	the branch target register.

diff -uprN ORIG/dataflow/gcc/bt-load.c LOCAL/dataflow/gcc/bt-load.c
--- ORIG/dataflow/gcc/bt-load.c	Sun Feb  4 16:25:05 2007
+++ LOCAL/dataflow/gcc/bt-load.c	Thu May 24 08:00:00 2007
@@ -1232,6 +1232,7 @@ move_btr_def (basic_block new_def_bb, in
       else
 	replacement_rtx = gen_rtx_REG (GET_MODE (user->use), btr);
       replace_rtx (user->insn, user->use, replacement_rtx);
+      df_insn_rescan (user->insn);
       user->use = replacement_rtx;
     }
 }



More information about the Gcc-patches mailing list