From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9851 invoked by alias); 30 Nov 2010 12:36:24 -0000 Received: (qmail 9740 invoked by uid 22791); 30 Nov 2010 12:36:23 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Nov 2010 12:36:18 +0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/46716] [4.3/4.4/4.5/4.6 Regression] bad code generated with -mno-sse2 -m64 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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.3.6 X-Bugzilla-Changed-Fields: Status CC AssignedTo Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 30 Nov 2010 12:59:00 -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 X-SW-Source: 2010-11/txt/msg03666.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46716 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW CC| |hjl at gcc dot gnu.org, | |hubicka at gcc dot gnu.org AssignedTo|jakub at gcc dot gnu.org |unassigned at gcc dot | |gnu.org --- Comment #3 from Jakub Jelinek 2010-11-30 12:35:56 UTC --- Well, apparently -mno-sse2 doesn't disable completely SSE2 use, vectors are still passed in %xmm* registers for -m64. See i386.c (type_natural_mode). The problem is that then we have a parameter, where data->nominal_mode (and passed_mode and promoted_mode) is BLKmode, but data->entry_parm is (reg:V2DF 21 xmm0 [ s1 ]). assign_parm_setup_block_p because of the BLKmode nominal_mode returns true and assign_parm_setup_block copies it in wordsize (DImode here) parts, incrementing REGNO for each part. So, we end up passing first half of first parameter in %xmm0, second half in %xmm1, first half of second parameter in %xmm1 and second half of second parameter in %xmm2 (both on the caller and callee side). I guess generic vector support in 3.4 was even more broken and it just didn't care and used V2DFmode for the type even with -mno-sse2. And of course using -mno-sse2 in x86-64 on code that uses vectors makes no sense at all. Anyway, not sure how to convince the middle-end to handle this "right" for whatever definition of right, without risking breaking other targets too much.