This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/56979] ICE in output_operand: invalid operand for code 'P'
- From: "rearnsha at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 03 Aug 2013 21:52:10 +0000
- Subject: [Bug target/56979] ICE in output_operand: invalid operand for code 'P'
- Auto-submitted: auto-generated
- References: <bug-56979-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56979
--- Comment #3 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
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.