On 4/16/19 12:47 PM, Peter Bergner wrote:
> The patch below fixes the issue not continuing if the allocno's conflict
> array is null and instead guarding the current conflict prints by that
> test.  If the conflict array is null, we instead now print out simple
> empty conflict info.  This now gives us what we'd expect to see:
> 
> ;; a5(r116,l0) conflicts:
> ;;     total conflict hard regs:
> ;;     conflict hard regs:
> 
> 
>   cp0:a0(r111)<->a4(r117)@330:move


Actually, if we keep the continue, it makes the patch smaller and more
readable.  How about this instead which gives the same output as the
previous patch?

Peter

        * ira-conflicts.c (print_allocno_conflicts): Always print something,
        even for allocno's with no conflicts.
        (print_conflicts): Print an extra newline.

Index: gcc/ira-conflicts.c
===================================================================
--- gcc/ira-conflicts.c (revision 270331)
+++ gcc/ira-conflicts.c (working copy)
@@ -633,7 +631,12 @@ print_allocno_conflicts (FILE * file, bo
       ira_object_conflict_iterator oci;
 
       if (OBJECT_CONFLICT_ARRAY (obj) == NULL)
-       continue;
+       {
+         fprintf (file, "\n;;     total conflict hard regs:\n");
+         fprintf (file, ";;     conflict hard regs:\n\n");
+         continue;
+       }
+
       if (n > 1)
        fprintf (file, "\n;;   subobject %d:", i);
       FOR_EACH_OBJECT_CONFLICT (obj, conflict_obj, oci)
@@ -683,6 +686,7 @@ print_conflicts (FILE *file, bool reg_p)
 
   FOR_EACH_ALLOCNO (a, ai)
     print_allocno_conflicts (file, reg_p, a);
+  putc ('\n', file);
 }
 
 /* Print information about allocno or only regno (if REG_P) conflicts

Reply via email to