From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27211 invoked by alias); 25 Mar 2012 12:01:17 -0000 Received: (qmail 27199 invoked by uid 22791); 25 Mar 2012 12:01:16 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 25 Mar 2012 12:01:04 +0000 From: "aoliva at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/52306] ICE in CSE Date: Sun, 25 Mar 2012 12:47: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: aoliva at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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: 2012-03/txt/msg02166.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52306 --- Comment #1 from Alexandre Oliva 2012-03-25 12:00:34 UTC --- The bug, duplicated by compiling attachment 26150, 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))) reload turns this into: (insn 639 287 640 40 (set (reg:SI 9 %a1) (mem/c:SI (plus:SI (reg/f:SI 14 %a6) (const_int -44 [0xffffffffffffffd4])) [13 %sfp+-44 S4 A16])) pr5 2306.c:278 36 {*movsi_m68k} (nil)) (insn 640 639 288 40 (set (mem/c:SI (plus:SI (reg/f:SI 14 %a6) (const_int -44 [0xffffffffffffffd4])) [13 %sfp+-44 S4 A16]) (plus:SI (mem/c:SI (plus:SI (reg/f:SI 14 %a6) (const_int -44 [0xffffffffffffffd4])) [13 %sfp+-44 S4 A16]) (const_int 4 [0x4]))) pr52306.c:278 132 {*addsi3_internal} (nil)) (insn 288 640 290 40 (set (reg:SI 9 %a1) (mem/f:SI (post_inc:SI (reg:SI 9 %a1)) [5 MEM[base: D.1889_285, offset: 0B]+0 S4 A16])) pr52306.c:278 37 {*movsi_m68k2} (expr_list:REG_INC (reg:SI 9 %a1) (nil))) reload correctly performs the post_inc in a separate insn, but it fails to remove the post_inc from the MEM that had it, so we end up with two concurrent modifications of the same register, which is not well-formed RTX.