From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3947 invoked by alias); 31 Dec 2013 11:47:31 -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 3911 invoked by uid 48); 31 Dec 2013 11:47:28 -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: Tue, 31 Dec 2013 11:47: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: --- 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: 2013-12/txt/msg02486.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59644 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hjl.tools at gmail dot com, | |hubicka at gcc dot gnu.org --- Comment #7 from Jakub Jelinek --- So, on this source file the only differences caused by r206243 are caused by the ix86_save_reg hunk, the 4 functions in question before pro_and_epilogue pass don't need dynamic stack realignment, drap_reg is set to r10 but isn't live at the beginning of the function, just used somewhere in the function. Previously we'd save/restore it anyway, I assume just in case it would be used by the epilogue if drap would be needed there (but it isn't), after my commit it isn't saved (r10 is call used register, so there is no point in saving/restoring it). So, I fail to see why this change is wrong, unless the kernel say calls one of those functions from assembly and mistakenly assumes r10 is not clobbered by the call. Note that if stack realignment would happen, then r10 would not be preserved even before the patch, in that case, while r10 is saved/restored, it is saved after it has been set to the DRAP value.