From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8577 invoked by alias); 3 Aug 2013 21:52:15 -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 8497 invoked by uid 48); 3 Aug 2013 21:52:12 -0000 From: "rearnsha at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/56979] ICE in output_operand: invalid operand for code 'P' Date: Sat, 03 Aug 2013 21:52: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.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rearnsha 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: --- 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: 2013-08/txt/msg00221.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56979 --- Comment #3 from Richard Earnshaw --- The problem here is that float2 has alignment 8, although this is not it's natural alignment (which would be 4). This argument is passed by value to the routine operator-(float, float2), and the compiler treats float2 as an HFA containing 2 floats; these get allocated to s1 and s2 under the AAPCS VFP rules. On entry to the function, the compiler then tries to store s1 and s2 as a pairwise (64-bit) type to the stack (since the type is 64-bit aligned) -- the latter fails because for this to work the 64-bit type must start with an even numbered register. The AAPCS does not describe what happens when arguments do not have their natural alignment -- most cases will almost certainly not work as expected, particularly if the alignment is greater than the natural stack alignment. Although the compiler shouldn't ICE, it's arguable that passing over-aligned values by value to functions is not supportable (c11, for example, does not support over-aligning function arguments even though it does permit over-aligning some other objects) and that this case is really an ICE on invalid.