[Bug target/94770] class with empty base passed incorrectly with -std=c++17 on mingw

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Apr 27 11:04:20 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94770

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #9)
> At least, when using:
> gcc version 9.2.1 20190827 (Fedora MinGW 9.2.1-1.fc31) (GCC) 
> and executing with Wine.

Yeah, I can clearly see it in the assembly that it must ICE, the big question
is what is the right ABI, if the empty structures are not passed at all (like
e.g. in the x86-64 clarified psABI), or if they are passed as clearly is what
happens in the caller.
On the va_arg side, for the MS ABI va_list seems to be a pointer and thus it
defers to the standard middle-end handling where it see a TYPE_EMPTY_P? struct
and uses 0 size instead of the actual one.
Now, not sure if we can tweak the *RECORD_EMPTY_P* target hook, because it
marks types rather than their uses, and in sources where both x86-64 psABI and
msabi are used together, we want TYPE_EMPTY_P being set for the former and
perhaps not? for the latter.
Of course, the backend coiuld check for the MSABI and TYPE_EMPTY_P type and
don't defer to the middle-end in that case and handle it differently.
BTW, when I tried clang++ (10.0.0 trunk 374035 version) with -target
x86_64-w64-mingw32, it seems it matches g++ on the caller side and does
something on the callee side, but I bet MSVC is the ABI etalon on this target,
right?


More information about the Gcc-bugs mailing list