This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/56979] ICE in output_operand: invalid operand for code 'P'


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]