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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot 
gnu.org

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I have a simple fix.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 9163dcda438..943c5cb8f2d 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6232,6 +6232,9 @@ gimplify_save_expr (tree *expr_p, gimple_seq *pre_p,
gimple_seq *post_p)
   gcc_assert (TREE_CODE (*expr_p) == SAVE_EXPR);
   val = TREE_OPERAND (*expr_p, 0);

+  if (TREE_TYPE (val) == error_mark_node)
+    return GS_ERROR;
+
   /* If the SAVE_EXPR has not been resolved, then evaluate it once.  */
   if (!SAVE_EXPR_RESOLVED_P (*expr_p))
     {

Reply via email to