This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/37769] internal compiler error: in reg_overlap_mentioned_for_reload_p, at reload.c:6525
- From: "kkojima at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Oct 2008 04:50:48 -0000
- Subject: [Bug rtl-optimization/37769] internal compiler error: in reg_overlap_mentioned_for_reload_p, at reload.c:6525
- References: <bug-37769-16403@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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