https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124086
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #4)
> VIEW_CONVERT_EXPR of register type needs to be outermost. gimplification
> would take care of that, but manually doing it requires some extra care.
> Possibly gimple_build (...) does not properly handle it?
The fix is to replace:
if (TREE_CODE (TREE_OPERAND (t, 0)) == SSA_NAME)
With:
expr = TREE_OPERAND (t, 0);
if (is_gimple_reg (expr)
|| (is_gimple_min_invariant (expr) && TREE_CODE (expr) != STRING_CST))
in extract_component where we are doing the manual creating of the gimple
statements. Note this code really needs a rewrite but that won't be until GCC
17.