From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27282 invoked by alias); 10 Feb 2014 16:48:08 -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 26882 invoked by uid 48); 10 Feb 2014 16:48:00 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/60116] [4.8/4.9 Regression] wrong code at -Os on x86_64-linux-gnu in 32-bit mode Date: Mon, 10 Feb 2014 16:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.9.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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: 2014-02/txt/msg00976.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60116 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.org, | |law at gcc dot gnu.org --- Comment #13 from Jakub Jelinek --- So, what happens is that we have: (insn 39 38 41 5 (set (reg:QI 119) (const_int 1 [0x1])) pr60116.c:17 93 {*movqi_internal} (expr_list:REG_DEAD (reg:CCZ 17 flags) (nil))) (insn 41 39 83 5 (set (reg:CCZ 17 flags) (compare:CCZ (reg:SI 101 [ D.1460 ]) (const_int 0 [0]))) pr60116.c:18 3 {*cmpsi_ccno_1} (nil)) (insn 83 41 42 5 (set (reg:SI 122 [ D.1465 ]) (zero_extend:SI (reg:QI 119))) 138 {*zero_extendqisi2} (expr_list:REG_DEAD (reg:QI 119) (nil))) (the REG_DEAD on flags on the first insn supposedly comes from earlier combining. try_combine is then called on i3=insn83 and i2=insn39 and manages to combine insn 83 into (set (reg:SI 122) (const_int 1 [0x1])). The problem is when distribute_notes attempts to distribute the REG_DEAD (reg:CCZ 17 flags) note from elim_i2=insn39 to i3=insn83.