We currently ICE when the locations include one without a setting insn.
Looking at cselib this seems to be a supported state so the following
arranges for this and dumps -1 as UID.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

        PR rtl-optimization/106859
        * var-tracking.cc (val_store): Dump -1 as UID if setting_insn
        is NULL.
---
 gcc/var-tracking.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/var-tracking.cc b/gcc/var-tracking.cc
index c95ca075a5f..bfe75b0577d 100644
--- a/gcc/var-tracking.cc
+++ b/gcc/var-tracking.cc
@@ -2519,7 +2519,8 @@ val_store (dataflow_set *set, rtx val, rtx loc, rtx_insn 
*insn,
          struct elt_loc_list *l;
          for (l = v->locs; l; l = l->next)
            {
-             fprintf (dump_file, "\n%i: ", INSN_UID (l->setting_insn));
+             fprintf (dump_file, "\n%i: ",
+                      l->setting_insn ? INSN_UID (l->setting_insn) : -1);
              print_inline_rtx (dump_file, l->loc, 0);
            }
        }
-- 
2.51.0

Reply via email to