d: Fix FAIL in gdc.dg/runnable.d on X32 targets (PR94609)
authorIain Buclaw <ibuclaw@gdcproject.org>
Sun, 19 Apr 2020 07:54:25 +0000 (09:54 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Sun, 19 Apr 2020 07:54:25 +0000 (09:54 +0200)
commit8a9ce39f8bbb2ae0798bec0ed2051a5f10b21122
treefc21a3367bf87c7264be4c8c3b30124fa1897449
parent56d207dd4003765481fb89710159d63dad571f05
d: Fix FAIL in gdc.dg/runnable.d on X32 targets (PR94609)

Patch fixes test failure seen on X32 where a nested struct was passed in
registers, rather than via invisible reference.  Now, all non-POD
structs are passed by invisible reference, not just those with a
user-defined copy constructor/destructor.

gcc/d/ChangeLog:

PR d/94609
* d-codegen.cc (argument_reference_p): Don't check TREE_ADDRESSABLE.
(type_passed_as): Build reference type if TREE_ADDRESSABLE.
* d-convert.cc (convert_for_argument): Build explicit TARGET_EXPR if
needed for arguments passed by invisible reference.
* types.cc (TypeVisitor::visit (TypeStruct *)): Mark all structs that
are not POD as TREE_ADDRESSABLE.
gcc/d/ChangeLog
gcc/d/d-codegen.cc
gcc/d/d-convert.cc
gcc/d/types.cc