From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30151 invoked by alias); 7 Oct 2014 14:15:29 -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 30091 invoked by uid 48); 7 Oct 2014 14:15:24 -0000 From: "andi-gcc at firstfloor dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/61969] [4.8/4.9/5 Regression] wrong code by LTO on i?86-linux-gnu (affecting trunk, 4.9.x, and 4.8.x) Date: Tue, 07 Oct 2014 14:15:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andi-gcc at firstfloor dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.4 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: 2014-10/txt/msg00470.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61969 --- Comment #6 from Andi Kleen --- I looked at this a bit more. It's definitely the nrv pass that causes the problem. When I disable it in the source code the 32bit version compiles correctly. I also tried disabling the next pass (cfgcleanup), but that didn't make a difference. It converts the local variable to be a value-expr. It's still not exactly clear who deletes the variable declaration though. There are two possibilities: - nrv shouldn't convert the variable in the first place - someone who messes with the variables forgets to check for value-exprs. ;; Function func_52 (func_52, funcdef_no=86, decl_uid=2858, cgraph_uid=54, symbol_order=1152) NRV Replaced: l_55 with: func_52 (uint32_t p_53) { extern const struct S0 l_55 = {.f0=4, .f1=40290, .f2=10, .f3=4} [value-expr: ]; : return ; }