This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/82128] [8 Regression] ICE on valid code


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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Trying

Index: gcc/gimple-fold.c
===================================================================
--- gcc/gimple-fold.c   (revision 252006)
+++ gcc/gimple-fold.c   (working copy)
@@ -3862,24 +3862,18 @@ gimple_fold_call (gimple_stmt_iterator *
                  tree fndecl = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
                  gimple *new_stmt = gimple_build_call (fndecl, 0);
                  gimple_set_location (new_stmt, gimple_location (stmt));
+                 /* If the call had a SSA name as lhs morph that into
+                    an uninitialized value.  */
                  if (lhs && TREE_CODE (lhs) == SSA_NAME)
                    {
                      tree var = create_tmp_var (TREE_TYPE (lhs));
-                     tree def = get_or_create_ssa_default_def (cfun, var);
-
-                     /* To satisfy condition for
-                        cgraph_update_edges_for_call_stmt_node,
-                        we need to preserve GIMPLE_CALL statement
-                        at position of GSI iterator.  */
-                     update_call_from_tree (gsi, def);
-                     gsi_insert_before (gsi, new_stmt, GSI_NEW_STMT);
-                   }
-                 else
-                   {
-                     gimple_set_vuse (new_stmt, gimple_vuse (stmt));
-                     gimple_set_vdef (new_stmt, gimple_vdef (stmt));
-                     gsi_replace (gsi, new_stmt, false);
+                     SET_SSA_NAME_VAR_OR_IDENTIFIER (lhs, var);
+                     SSA_NAME_DEF_STMT (lhs) = gimple_build_nop ();
+                     set_ssa_default_def (cfun, var, lhs);
                    }
+                 gimple_set_vuse (new_stmt, gimple_vuse (stmt));
+                 gimple_set_vdef (new_stmt, gimple_vdef (stmt));
+                 gsi_replace (gsi, new_stmt, false);
                  return true;
                }
            }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]