[Bug middle-end/107307] [12/13 Regression] ICE tree check: expected class 'type', have 'exceptional' (error_mark) in canonicalize_component_ref, at gimplify.cc:2923 since r12-3278-g823685221de986af

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 17 20:41:58 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107307

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=106765

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Actually the patch which works better:
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index f06ce3cc77a..c62a966e918 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -3272,6 +3272,8 @@ gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p,
gimple_seq *post_p,
   tret = gimplify_expr (p, pre_p, post_p, is_gimple_min_lval,
                        fallback | fb_lvalue);
   ret = MIN (ret, tret);
+  if (ret == GS_ERROR)
+    return GS_ERROR;

   /* Step 2a: if we have component references we do not support on
      registers then make sure the base isn't a register.  Of course



Also fixes PR 106765.


More information about the Gcc-bugs mailing list