]> git.ipfire.org Git - thirdparty/gcc.git/commit
d: Fix ICE in must_pass_in_stack_var_size_or_pad with D enums [PR123411] master trunk
authorIain Buclaw <ibuclaw@gdcproject.org>
Mon, 20 Apr 2026 17:54:02 +0000 (19:54 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Mon, 20 Apr 2026 18:34:13 +0000 (20:34 +0200)
commit416fe77efb4ff6adf39c3326d462161217b75b42
tree8d35715fc069eae44b90c0932242fbf74608efa4
parent8e6b7c97232489557e376bdc134ad69aaeb35794
d: Fix ICE in must_pass_in_stack_var_size_or_pad with D enums [PR123411]

An `enum : enum A` type caused the already computed underlying type size
of `enum A` to be overwritten with NULL_TREE.  To fix, don't finish the
enum with layout_type unless we're handling the main variant type.

PR d/123411

gcc/d/ChangeLog:

* types.cc (TypeVisitor::visit (TypeEnum *)): Only call layout_type on
the TYPE_MAIN_VARIANT of the enum.

gcc/testsuite/ChangeLog:

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