http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336
--- Comment #17 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Jason Merrill from comment #15)
> That only documents that sizeof is different for C and C++, the calling
> convention should be the same. And it seems like classify_argument should
> already be returning 1 with classes[0]==NO_CLASS for both C and C++. Why
> are we getting different results?
classify_argument has an early exit:
/* Zero sized arrays or structures are NO_CLASS. We return 0 to
signalize memory class, so handle it as special case. */
if (!words)
{
classes[0] = X86_64_NO_CLASS;
return 1;
}
but it doesn't trigger for c++, where words gets calculated as 1.