From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11441 invoked by alias); 21 Feb 2015 21:58:35 -0000 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 Received: (qmail 11372 invoked by uid 48); 21 Feb 2015 21:58:30 -0000 From: "olegendo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65151] [SH][4.9 Regression] Internal compiler error when trying to build libav 11.2 on sh4 Date: Sat, 21 Feb 2015 23:09:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: olegendo at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-02/txt/msg02403.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65151 --- Comment #6 from Oleg Endo --- (In reply to Oleg Endo from comment #5) > The problem is the following insn: > > (insn 45 11 12 2 (set (reg:HI 168 [ x ]) > (subreg/s/u:HI (reg:SI 147 t) 0)) cchMsw9Z.out:9 -1 > (expr_list:REG_DEAD (reg:SI 147 t) > (nil))) > > which is not in sh.md. > The insn is created by the asmcons pass. More precisely, it's 'emit_move_insn' in gcc/function.c in function match_asm_constraints_1 at line 7152. BTW, the test case from attachment 34825 also fails at -O1, -O2 and -Os. On current trunk (GCC 5), the problem doesn't happen due to the treg_set_expr stuff that has been recently added, it seems. After combine, the insns are: (insn 11 8 12 2 (parallel [ (set (reg/v:SI 163 [ x ]) (eq:SI (reg:SI 6 r6 [ bits_per_component ]) (const_int 10 [0xa]))) (clobber (reg:SI 147 t)) ]) 410 {any_treg_expr_to_reg} (expr_list:REG_UNUSED (reg:SI 147 t) (expr_list:REG_DEAD (reg:SI 6 r6 [ bits_per_component ]) (nil)))) (insn 12 11 13 2 (set (reg:HI 170 [ x ]) (asm_operands:HI ("swap.b %0,%0") ("=r") 0 [ (subreg/s/v:HI (reg/v:SI 163 [ x ]) 0) ] [ (asm_input:HI ("0") cchMsw9Z.out:8) ] [] cchMsw9Z.out:8)) cchMsw9Z.out:8 -1 (expr_list:REG_DEAD (reg/v:SI 163 [ x ]) (nil))) Which is then converted by the treg_set_expr splitter code during the split1 pass into: (insn 52 8 53 2 (set (reg:SI 147 t) (eq:SI (reg:SI 6 r6 [ bits_per_component ]) (const_int 10 [0xa]))) -1 (nil)) (insn 53 52 12 2 (set (reg/v:SI 163 [ x ]) (reg:SI 147 t)) -1 (expr_list:REG_UNUSED (reg:SI 147 t) (nil))) (insn 12 53 13 2 (set (reg:HI 170 [ x ]) (asm_operands:HI ("swap.b %0,%0") ("=r") 0 [ (subreg/s/v:HI (reg/v:SI 163 [ x ]) 0) ] [ (asm_input:HI ("0") cchMsw9Z.out:8) ] [] cchMsw9Z.out:8)) cchMsw9Z.out:8 -1 (expr_list:REG_DEAD (reg/v:SI 163 [ x ]) (nil))) In asmcons, emit_move_insn then adds the following insn: (insn 58 53 12 2 (set (reg:HI 170 [ x ]) (subreg/s/v:HI (reg/v:SI 163 [ x ]) 0)) cchMsw9Z.out:8 -1 (nil)) from there on everything works out.