[Bug tree-optimization/52037] [4.7 regression] ICE in update_ssa, at tree-into-ssa.c:3362 while linking LTO libxul

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 30 12:46:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52037

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-30 12:12:31 UTC ---
Both TODO_update_ssa and TODO_update_ssa_only_virtuals are set.  The assert
happens after IPA inline-transform.  Probably happens because

  if (!(todo & TODO_update_ssa_any))
    /* Redirecting edges might lead to a need for vops to be recomputed.  */
    todo |= TODO_update_ssa_only_virtuals;

  cfun->always_inline_functions_inlined = true;
  cfun->after_inlining = true;
  return todo | execute_fixup_cfg ();

does not account for the fact execute_fixup_cfg might return TODO_update_ssa
which is really not necessary:

          if (decl)
            {
              int flags = gimple_call_flags (stmt);
              if (flags & (ECF_CONST | ECF_PURE | ECF_LOOPING_CONST_OR_PURE))
                {
                  if (gimple_purge_dead_abnormal_call_edges (bb))
                    todo |= TODO_cleanup_cfg;

                  if (gimple_in_ssa_p (cfun))
                    {
                      todo |= TODO_update_ssa | TODO_cleanup_cfg;
                      update_stmt (stmt);
                    }

only virtuals may need updating here.

Less dangerous (considering other callers) might be to simply adjust
the code in inline-transform.

"Obvious" patch for this:

Index: gcc/ipa-inline-transform.c
===================================================================
--- gcc/ipa-inline-transform.c  (revision 183695)
+++ gcc/ipa-inline-transform.c  (working copy)
@@ -369,11 +369,13 @@ inline_transform (struct cgraph_node *no
     todo = optimize_inline_calls (current_function_decl);
   timevar_pop (TV_INTEGRATION);

+  cfun->always_inline_functions_inlined = true;
+  cfun->after_inlining = true;
+  todo |= execute_fixup_cfg ();
+
   if (!(todo & TODO_update_ssa_any))
     /* Redirecting edges might lead to a need for vops to be recomputed.  */
     todo |= TODO_update_ssa_only_virtuals;

-  cfun->always_inline_functions_inlined = true;
-  cfun->after_inlining = true;
-  return todo | execute_fixup_cfg ();
+  return todo;
 }



More information about the Gcc-bugs mailing list