https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123365
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:319db4667fbed5180a1ecc687ff8556d2447760a commit r16-7571-g319db4667fbed5180a1ecc687ff8556d2447760a Author: Jakub Jelinek <[email protected]> Date: Wed Feb 18 17:46:38 2026 +0100 c: Call relayout_decl in build_compound_literal when completing type [PR123365] Most other spots inthe C FE which change type of some VAR_DECL through complete_array_type call relayout_decl to fix up DECL_MODE etc., but build_compound_literal strangely does not. It has layout_decl (decl, 0); call later on but I think that is quite useless given that already the build_decl call earlier calls that and so the second layout_decl probably does nothing most of the time. On the following testcase, the compound literal VAR_DECL has BLKmode from the time it had incomplete array type and isn't changed to DImode that the completed type has and asm stmt expansion is unhappy about that. Fixed thusly. 2026-02-18 Jakub Jelinek <[email protected]> PR c/123365 * c-decl.cc (build_compound_literal): Call relayout_decl after completing the type. * gcc.c-torture/compile/pr123365.c: New test.
