From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13778 invoked by alias); 30 Jan 2013 17:34:51 -0000 Received: (qmail 12140 invoked by uid 48); 30 Jan 2013 17:34:15 -0000 From: "mikpe at it dot uu.se" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/52306] ICE in cselib_record_set, at cselib.c:2158 Date: Wed, 30 Jan 2013 17:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mikpe at it dot uu.se X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2013-01/txt/msg02796.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52306 --- Comment #15 from Mikael Pettersson 2013-01-30 17:34:11 UTC --- (In reply to comment #1) > The bug, duplicated by compiling attachment 26150 [details], from bug 43437 comment 16, > with a cross-compiler to m68k-elf with -O -c, exposes a reload problem. Before > reload, we have this insn: > > (insn 288 287 290 40 (set (reg/f:SI 124 [ D.1788 ]) > (mem/f:SI (post_inc:SI (reg:SI 145 [ ivtmp.76 ])) [5 MEM[base: > D.1889_285, offset: 0B]+0 S4 A16])) pr52306.c:278 37 {*movsi_m68k2} > (expr_list:REG_INC (reg:SI 145 [ ivtmp.76 ]) > (nil))) But isn't this already invalid, as it has both a post_inc and a REG_INC of the same (reg:SI 145 [ ivtmp.76 ]) operand? This is produced by the auto_inc_dec pass. Before that we have (175r.fwprop2): (insn 188 187 190 22 (set (reg/v:SI 76 [ i ]) (plus:SI (reg/v:SI 76 [ i ]) (const_int 1 [0x1]))) pr43437-2.c:222 132 {*addsi3_internal} (nil)) (insn 190 188 191 22 (set (cc0) (compare (reg/v:SI 76 [ i ]) (reg/v:SI 68 [ n ]))) pr43437-2.c:222 14 {*m68k.md:486} (nil)) which auto_inc_dec turns into (176r.auto_inc_dec): 289 r145:SI=r145:SI+0x4 288 r124:SI=[r145:SI] 288 r124:SI=[r145:SI] found mem(288) *(r[145]+0) 289 r145:SI=r145:SI+0x4 found post inc(289) r[145]+=4 trying SIMPLE_POST_INC rescanning insn with uid = 288. deleting insn with uid = 288. deleting insn with uid = 289. ****success 288 r124:SI=[r145:SI++] REG_INC: r145:SI ... 288 r124:SI=[r145:SI++] REG_INC: r145:SI ... (insn 288 287 290 41 (set (reg/f:SI 124 [ D.1812 ]) (mem/f:SI (post_inc:SI (reg:SI 145 [ ivtmp.80 ])) [5 MEM[base: D.1914_291, offset: 0B]+0 S4 A16])) pr43437-2.c:278 37 {*movsi_m68k2} (expr_list:REG_INC (reg:SI 145 [ ivtmp.80 ]) (nil))) Is this valid?