d: Fix ICE in in add_stack_var, at cfgexpand.cc:476
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 8 Aug 2022 13:17:47 +0000 (15:17 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Mon, 8 Aug 2022 18:29:04 +0000 (20:29 +0200)
commitfc7166a7c409bf231d5f243636f30904deea6e6f
treec7ef1b4517ebcddadcb452aab7214e8378f72961
parent556e5a3b1e4f2cfe53ae2f4c4d106965807ea723
d: Fix ICE in in add_stack_var, at cfgexpand.cc:476

The type that triggers the ICE never got completed by the semantic
analysis pass.  Checking for size forces it to be done, or issue a
compile-time error.

PR d/106555

gcc/d/ChangeLog:

* d-target.cc (Target::isReturnOnStack): Check for return type size.

gcc/testsuite/ChangeLog:

* gdc.dg/imports/pr106555.d: New test.
* gdc.dg/pr106555.d: New test.

(cherry picked from commit 4b0253b019943abf2cc5f4db0b7ed67caedffe4a)
gcc/d/d-target.cc
gcc/testsuite/gdc.dg/imports/pr106555.d [new file with mode: 0644]
gcc/testsuite/gdc.dg/pr106555.d [new file with mode: 0644]