[Bug middle-end/71308] [7 Regression] ICE (segfault) in in gimple_fold_call gimple-fold.c:3060

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 27 12:00:00 GMT 2016


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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Ah, that must be mine :(.
Fix:
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -3053,7 +3053,8 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool
inplace)
              == void_type_node))
            gimple_call_set_fntype (stmt, TREE_TYPE (fndecl));
          /* If the call becomes noreturn, remove the lhs.  */
-         if (gimple_call_noreturn_p (stmt)
+         if (lhs
+             && gimple_call_noreturn_p (stmt)
              && (VOID_TYPE_P (TREE_TYPE (gimple_call_fntype (stmt)))
              || should_remove_lhs_p (lhs)))
            {


More information about the Gcc-bugs mailing list