From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4452 invoked by alias); 9 Oct 2008 04:52:16 -0000 Received: (qmail 4193 invoked by uid 48); 9 Oct 2008 04:50:48 -0000 Date: Thu, 09 Oct 2008 04:52:00 -0000 Message-ID: <20081009045048.4192.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug rtl-optimization/37769] internal compiler error: in reg_overlap_mentioned_for_reload_p, at reload.c:6525 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "kkojima at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-10/txt/msg00616.txt.bz2 ------- Comment #4 from kkojima at gcc dot gnu dot org 2008-10-09 04:50 ------- The regmove pass changes insns in .160r.ce2 dump (insn 285 77 78 6 foo.C:14 (set (reg/f:SI 260) (reg/f:SI 269 [ ivtmp.66 ])) -1 (expr_list:REG_DEAD (reg/f:SI 269 [ ivtmp.66 ]) (nil))) (insn 78 285 79 6 foo.C:14 (parallel [ (set (reg:SF 280) (mem:SF (post_inc:SI (reg/f:SI 260)) [2 S4 A32])) (use (reg/v:PSI 151 )) (clobber (scratch:SI)) ]) 205 {movsf_ie} (expr_list:REG_INC (reg/f:SI 260) (nil))) to (insn:HI 285 77 78 6 foo.C:14 (set (reg/f:SI 269 [ ivtmp.66 ]) (reg/f:SI 269 [ ivtmp.66 ])) -1 (nil)) (insn:HI 78 285 79 6 foo.C:14 (parallel [ (set (reg:SF 280) (mem:SF (post_inc:SI (reg/f:SI 269 [ ivtmp.66 ])) [2 S4 A32])) (use (reg/v:PSI 151 )) (clobber (scratch:SI)) ]) 205 {movsf_ie} (expr_list:REG_INC (reg/f:SI 260) (nil))) in .162r.regmove. It seems that regmove forgets to update the register 260 to 269 in REG_INC note of the insn 78 and this wrong REG_INC note causes the ICE. Now I'm testing the attached patch, for 4.3-branch. BTW, please use the compiler based on the vanilla FSF tree for bugzilla as Andrew has pointed out already. --- ORIG/gcc-4_3-branch/gcc/regmove.c 2008-02-20 06:48:51.000000000 +0900 +++ LOCAL/gcc-4_3-branch/gcc/regmove.c 2008-10-09 10:50:29.000000000 +0900 @@ -687,6 +687,12 @@ optimize_reg_copy_2 (rtx insn, rtx dest, if (reg_mentioned_p (dest, PATTERN (q))) { PATTERN (q) = replace_rtx (PATTERN (q), dest, src); + if (FIND_REG_INC_NOTE (q, dest)) + { + remove_note (q, find_reg_note (q, REG_INC, dest)); + REG_NOTES (q) + = gen_rtx_EXPR_LIST (REG_INC, src, REG_NOTES (q)); + } df_insn_rescan (q); } -- kkojima at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kkojima at gcc dot gnu dot | |org Status|UNCONFIRMED |NEW Component|target |rtl-optimization Ever Confirmed|0 |1 GCC target triplet|sh4-*-linux |sh4-*-* Keywords| |ice-on-valid-code Known to fail| |4.3.2 4.4.0 Known to work| |4.2.4 Priority|P3 |P4 Last reconfirmed|0000-00-00 00:00:00 |2008-10-09 04:50:48 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37769