]> git.ipfire.org Git - thirdparty/gcc.git/commit
d: internal compiler error: in convert_move, at expr.cc:227
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 5 May 2026 20:00:28 +0000 (22:00 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Tue, 5 May 2026 21:47:30 +0000 (23:47 +0200)
commit2dde6c91d0f0df9ebef57955b92a6dfd30bea480
tree36c5662f647ae4d6db275f5d4c40dfde276c9c41
parent710581c80b2fd39fa7a8674eccf7dca8cbc7c9c0
d: internal compiler error: in convert_move, at expr.cc:227

This was caused by a forward reference of a nested struct changing the
TYPE_MODE of its enclosing struct type to be incorrectly inferred as an
integer mode.  Fixed by setting TREE_ADDRESSABLE early, and moving the
mode setting and propagation to finish_aggregate_mode and
finish_aggregate_type respectively, rather than at the end of the
visitor method for TypeStruct.

PR d/125089

gcc/d/ChangeLog:

* types.cc (finish_aggregate_mode): Explicitly set TYPE_MODE of
non-POD types here.
(finish_aggregate_type): Propagate TREE_ADDRESSABLE to all variants.
(TypeVisitor::visit (TypeStruct *)): Set TREE_ADDRESSABLE before
visiting struct members.

gcc/testsuite/ChangeLog:

* gdc.dg/pr125089.d: New test.
gcc/d/types.cc
gcc/testsuite/gdc.dg/pr125089.d [new file with mode: 0644]