On Thu, 2016-11-03 at 17:43 +0100, Bernd Schmidt wrote:
> On 11/03/2016 05:35 PM, Martin Jambor wrote:
> > 
> >     * print-rtl.c (print_rtx_operand_codes_E_and_V): Print how many
> > times
> >     an element is repeated istead of printing each repeated
> > element.
> 
> "instead"
> 
> > ---
> >  gcc/print-rtl.c | 15 ++++++++++++++-
> >  1 file changed, 14 insertions(+), 1 deletion(-)
> > 
> > diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
> > index 341ecdf..9752c85 100644
> > --- a/gcc/print-rtl.c
> > +++ b/gcc/print-rtl.c
> > @@ -252,7 +252,20 @@ rtx_writer::print_rtx_operand_codes_E_and_V
> > (const_rtx in_rtx, int idx)
> >     m_sawclose = 1;
> > 
> >        for (int j = 0; j < XVECLEN (in_rtx, idx); j++)
> > -   print_rtx (XVECEXP (in_rtx, idx, j));
> > +   {
> > +     int j1;
> > +
> > +     print_rtx (XVECEXP (in_rtx, idx, j));
> > +     for (j1 = j + 1; j1 < XVECLEN (in_rtx, idx); j1++)
> > +       if (XVECEXP (in_rtx, idx, j) != XVECEXP (in_rtx, idx,
> > j1))
> > +         break;
> > +
> > +     if (j1 != j + 1)
> > +       {
> > +         fprintf (m_outfile, " repeated %ix", j1 - j);
> > +         j = j1;
> > +       }
> > +   }
> Good idea, but can you give an example of how this looks in practice?

It should be possible to create a simple selftest of this (for pre
-existing examples, look for ASSERT_RTL_DUMP_EQ in gcc/rtl-tests.c).

> Also, it would be nice (and necessary for David's rtl-testing) to
> also 
>  
> teach the rtl reader to parse this format.

Yes please, ideally with a selftest, though that may be tricky until
the rtl-testing work goes in.

(I suppose it could be disabled in compact mode, but that seems to be
an abuse of the term "compact").

Reply via email to