https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106139
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-11 branch has been updated by Iain Buclaw <ibuc...@gcc.gnu.org>: https://gcc.gnu.org/g:488759b7ea16972c4dfbb62926cd71996b1f77a7 commit r11-10109-g488759b7ea16972c4dfbb62926cd71996b1f77a7 Author: Iain Buclaw <ibuc...@gdcproject.org> Date: Wed Jun 29 21:52:39 2022 +0200 d: Fix error: aggregate value used where floating point was expected Casting from vector to static array is permitted, and the frontend generates a reinterpret cast, but casting back the other way resulted in an error. This has been fixed to be properly handled in the code generation pass of VectorExp, and the conversion for lvalue and rvalue handling done in convert_expr and convert_for_rvalue respectively. PR d/106139 gcc/d/ChangeLog: * d-convert.cc (convert_expr): Handle casting from array to vector. (convert_for_rvalue): Rewrite vector to array casts of the same element type into a constructor. (convert_for_assignment): Return calling convert_for_rvalue. * dmd/expressionsem.c (ExpressionSemanticVisitor::visit): Run semantic on vector expression after lowering. * expr.cc (ExprVisitor::visit (VectorExp *)): Handle generating a vector expression from a static array. * toir.cc (IRVisitor::visit (ReturnStatement *)): Call convert_for_rvalue on return value. gcc/testsuite/ChangeLog: * gdc.dg/pr106139a.d: New test. * gdc.dg/pr106139b.d: New test. * gdc.dg/pr106139c.d: New test. * gdc.dg/pr106139d.d: New test. * gdc.test/fail_compilation/ice20264.d: New test. (cherry picked from commit 329bef49da30158d30fed1106002bb71674776bd)