From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8032 invoked by alias); 21 Nov 2014 17:51:12 -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 7968 invoked by uid 48); 21 Nov 2014 17:51:07 -0000 From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/63661] [4.9/5 Regression] -O2 miscompiles with -mtune=nehalem or corei7 Date: Fri, 21 Nov 2014 17:51: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.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm 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: 4.9.3 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-11/txt/msg02457.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661 --- Comment #20 from Martin Jambor --- So had a look at what my tiny bit in IRA does with this testcase and while it certainly triggers the bug, I don't think it causes it. It performs exactly the same modifications as when -mtune=nehalem is not specified on the command line. The functions I introduced split life-ranges of three registers, an SI mode one, DF mode one and a DI mode one. The bug occurs when both the latter two (DF and DI mode) are split. One suspicious thing is that in the nehalem case, the DF register is assigned to r12 (as opposed to a stack spill in the non-nehalem case) but I think that register is killed before being used, and (coincidentally?) it is being overwritten by the value from the DI-life-split register (r15) - in what seems like another effort of IRA to split their life-range but with one crucial instruction being lost (as in not present after reload). I'm afraid I'll need help of someone who knows IRA, Vladimir, could you please have a look at what happens in function bar during IRA and reload?