[Bug rtl-optimization/83422] [8 Regression] ICE: in final_scan_insn, at final.c:2429 after "variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without"

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 14 11:39:00 GMT 2017


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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, at minimum I think we need something like:
--- gcc/var-tracking.c.jj       2017-12-14 12:02:07.000000000 +0100
+++ gcc/var-tracking.c  2017-12-14 12:31:22.802421765 +0100
@@ -10328,6 +10328,10 @@ delete_vta_debug_insns (void)
            else
              delete_insn (insn);
          }
+       else if (NOTE_P (insn)
+                && NOTE_KIND (insn) == NOTE_INSN_BEGIN_STMT
+                && !cfun->debug_nonbind_markers)
+         delete_insn (insn);
     }
 }

@@ -10424,8 +10428,8 @@ variable_tracking_main_1 (void)
   if (!flag_var_tracking)
     return 0;

-  if (n_basic_blocks_for_fn (cfun) > 500 &&
-      n_edges_for_fn (cfun) / n_basic_blocks_for_fn (cfun) >= 20)
+  if (n_basic_blocks_for_fn (cfun) > 500
+      && n_edges_for_fn (cfun) / n_basic_blocks_for_fn (cfun) >= 20)
     {
       vt_debug_insns_local (true);
       return 0;

But, I wonder why we ever clear cfun->debug_nonbind_markers in var-tracking.c.
If the debug markers are useless without -fvariable-tracking-assignments, then
I'm not sure why those aren't guarded by that too (and why we ever enable
statemetn frontiers without -fvar-tracking-assignments).  If they are useful
even without -fvar-tracking-assignments, but we need a successful
vt_find_locations + vt_emit_notes, then we should drop them only if that didn't
pass (in case we run into the limits and fail -fvar-tracking-assignments
vt_find_locations, we can still successfully vt_find_locations + vt_emit_notes
without -fvar-tracking-assignments).

Alex, please say what is the case here.


More information about the Gcc-bugs mailing list