https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107307
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Simple fix:
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index f06ce3cc77a..bd772c15bec 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -3319,7 +3319,9 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p,
gimple_seq *post_p,
}
/* If the outermost expression is a COMPONENT_REF, canonicalize its type.
*/
- if ((fallback & fb_rvalue) && TREE_CODE (*expr_p) == COMPONENT_REF)
+ if (ret != GS_ERROR
+ && (fallback & fb_rvalue)
+ && TREE_CODE (*expr_p) == COMPONENT_REF)
{
canonicalize_component_ref (expr_p);
}
I am going to submit this and PR 106764 together.