From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46691 invoked by alias); 21 Oct 2015 18:42:21 -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 46651 invoked by uid 48); 21 Oct 2015 18:42:16 -0000 From: "vmakarov at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/67609] [5/6 Regression] Generates wrong code for SSE2 _mm_load_pd Date: Wed, 21 Oct 2015 18:42: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: 5.2.1 X-Bugzilla-Keywords: ra, wrong-code X-Bugzilla-Severity: major X-Bugzilla-Who: vmakarov at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.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: 2015-10/txt/msg01761.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67609 --- Comment #17 from Vladimir Makarov --- (In reply to Jeffrey A. Law from comment #16) > reload has traditionally removed subregs of hardregs and passes after reload > have depended on that behaviour. Doing something similar in lra is > obviously necessary. In fact, subregs of multi-word hard regs isn't ever > supposed to appear in the except during allocation & reloading. > > I'm not sure why final has another call to cleanup_subreg_operands. While > git blame blames me, I was just refactoring existing code code back in '98. > > Does that shed any light on what the right behaviour for LRA ought to be? LRA before the patch did the same as reload. This case shows that still some subregs should stay after reload otherwise we have wrong transformations (as making insn setting high part of the register a dead insn). Of course, some optimizations can not deal with subregs of multi-regs. The patch avoids keeping such subregs. I also found x86 reg-stack pass can not deal with any subregisters of stack fp regs. In any case I spent a lot of time for this small patch which works for at least 5 tested targets. I guess what we need more is to make final pass (at least for x86-64) to deal with the rest of subregs in a right way.