Patchwork one more sched-vis fix

login
register
mail settings
Submitter Steven Bosscher
Date Aug. 3, 2012, 8:02 a.m.
Message ID <CABu31nPhNr8cGG-1YoK+HOgZbOOe+nstAMm5CfyPMXh1EC7Qrg@mail.gmail.com>
Download mbox | patch
Permalink /patch/174939/
State New
Headers show

Comments

Steven Bosscher - Aug. 3, 2012, 8:02 a.m.
Hello,

I also need to handle SEQUENCE, of course, or slim dumping fails in
targets with branch delay slots. But who knew SEQUENCE can also appear
as a REG_NOTE value?!

The cfgrtl.c fix is purely cosmetic and obvious.

Bootstrapped&tested on powerpc64-unknown-linux-gnu. Committed as obvious.

Ciao!
Steven

       * sched-vis (print_pattern): Handle SEQUENCE also.
       * cfgrtl.c (print_rtl_with_bb): Do not print a newline between insns.

       free (start);
Andrey Belevantsev - Aug. 6, 2012, 11:16 a.m.
Hi Steven,

On 03.08.2012 12:02, Steven Bosscher wrote:
> Hello,
>
> I also need to handle SEQUENCE, of course, or slim dumping fails in
> targets with branch delay slots. But who knew SEQUENCE can also appear
> as a REG_NOTE value?!
>
> The cfgrtl.c fix is purely cosmetic and obvious.
>
> Bootstrapped&tested on powerpc64-unknown-linux-gnu. Committed as obvious.

You can even close PR 47489 as fixed then :)

Andrey

>
> Ciao!
> Steven
>
>         * sched-vis (print_pattern): Handle SEQUENCE also.
>         * cfgrtl.c (print_rtl_with_bb): Do not print a newline between insns.
>
> Index: sched-vis.c
> ===================================================================
> --- sched-vis.c (revision 190016)
> +++ sched-vis.c (working copy)
> @@ -610,8 +610,19 @@ print_pattern (char *buf, const_rtx x, int verbose
>         }
>         break;
>       case SEQUENCE:
> -      /* Should never see SEQUENCE codes until after reorg.  */
> -      gcc_unreachable ();
> +      {
> +       int i;
> +
> +       sprintf (t1, "sequence{");
> +       for (i = 0; i < XVECLEN (x, 0); i++)
> +         {
> +           print_pattern (t2, XVECEXP (x, 0, i), verbose);
> +           sprintf (t3, "%s%s;", t1, t2);
> +           strcpy (t1, t3);
> +         }
> +       sprintf (buf, "%s}", t1);
> +      }
> +      break;
>       case ASM_INPUT:
>         sprintf (buf, "asm {%s}", XSTR (x, 0));
>         break;
> Index: cfgrtl.c
> ===================================================================
> --- cfgrtl.c    (revision 190112)
> +++ cfgrtl.c    (working copy)
> @@ -1958,10 +1958,9 @@ print_rtl_with_bb (FILE *outf, const_rtx rtx_first
>                    dump_bb_info (outf, bb, 0, dump_flags | TDF_COMMENT,
> false, true);
>                    if (df && (flags & TDF_DETAILS))
>                      df_dump_bottom (bb, outf);
> +                 putc ('\n', outf);
>                  }
>              }
> -
> -         putc ('\n', outf);
>          }
>
>         free (start);
>
Steven Bosscher - Aug. 6, 2012, 11:20 a.m.
On Mon, Aug 6, 2012 at 1:16 PM, Andrey Belevantsev <abel@ispras.ru> wrote:
> Hi Steven,
>
>
> On 03.08.2012 12:02, Steven Bosscher wrote:
>>
>> Hello,
>>
>> I also need to handle SEQUENCE, of course, or slim dumping fails in
>> targets with branch delay slots. But who knew SEQUENCE can also appear
>> as a REG_NOTE value?!
>>
>> The cfgrtl.c fix is purely cosmetic and obvious.
>>
>> Bootstrapped&tested on powerpc64-unknown-linux-gnu. Committed as obvious.
>
>
> You can even close PR 47489 as fixed then :)

Heh, nice :-)

Thus, closed as fixed. Thanks!

Ciao!
Steven

Patch

Index: sched-vis.c
===================================================================
--- sched-vis.c (revision 190016)
+++ sched-vis.c (working copy)
@@ -610,8 +610,19 @@  print_pattern (char *buf, const_rtx x, int verbose
       }
       break;
     case SEQUENCE:
-      /* Should never see SEQUENCE codes until after reorg.  */
-      gcc_unreachable ();
+      {
+       int i;
+
+       sprintf (t1, "sequence{");
+       for (i = 0; i < XVECLEN (x, 0); i++)
+         {
+           print_pattern (t2, XVECEXP (x, 0, i), verbose);
+           sprintf (t3, "%s%s;", t1, t2);
+           strcpy (t1, t3);
+         }
+       sprintf (buf, "%s}", t1);
+      }
+      break;
     case ASM_INPUT:
       sprintf (buf, "asm {%s}", XSTR (x, 0));
       break;
Index: cfgrtl.c
===================================================================
--- cfgrtl.c    (revision 190112)
+++ cfgrtl.c    (working copy)
@@ -1958,10 +1958,9 @@  print_rtl_with_bb (FILE *outf, const_rtx rtx_first
                  dump_bb_info (outf, bb, 0, dump_flags | TDF_COMMENT,
false, true);
                  if (df && (flags & TDF_DETAILS))
                    df_dump_bottom (bb, outf);
+                 putc ('\n', outf);
                }
            }
-
-         putc ('\n', outf);
        }