From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3358 invoked by alias); 6 Jan 2014 11:28:42 -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 3310 invoked by uid 48); 6 Jan 2014 11:28:37 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/59644] [4.9 Regression] r206243 miscompiles Linux kernel Date: Mon, 06 Jan 2014 11:28:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 4.9.0 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-01/txt/msg00517.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59644 --- Comment #21 from Jakub Jelinek --- (In reply to Markus Trippelsdorf from comment #20) > (In reply to Jakub Jelinek from comment #19) > > (In reply to Markus Trippelsdorf from comment #17) > > > If I add "pushq %r10" and "popq %r10" by hand, the kernel boots fine. > > > > Thanks. Now, can you please try to use pushq %r9 and popq %r9 instead? > > Adding "pushq %r9" and "popq %r9" also results in a bootable kernel... Ah, I see what is going wrong, sorry for your wasted time. The problem is that ix86_save_reg is called already with crtl->stack_realign_finalized == false, e.g. in ix86_initial_elimination_offset, at that point ix86_save_reg will return true for the drap register and thus it is accounted for during RA, but if we don't count it later on, ix86_compute_frame_layout will compute a different layout.