This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add option for dumping to stderr (issue6190057)
- From: Sharad Singhai <singhai at google dot com>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Xinliang David Li <davidxl at google dot com>, Gabriel Dos Reis <gdr at integrable-solutions dot net>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Andrew Pinski <pinskia at gmail dot com>
- Date: Thu, 13 Sep 2012 08:01:39 -0700
- Subject: Re: [PATCH] Add option for dumping to stderr (issue6190057)
- References: <20120509064637.22949A2081@nabu.mtv.corp.google.com> <CAAiZkiCAjA9cLMdqQeMgBuftxQ+oSa0m0yxohs33=qOCVBc17w@mail.gmail.com> <CAKxPW65MhmoGHQ0u2_0tsQc=9VfXCN4+afmqBULDKM=LwZqHvg@mail.gmail.com> <CAAkRFZLRb7ShAzoUSP9eQV8qchJxu_n=DrR19n0OLfKK9f-fSw@mail.gmail.com> <CAFiYyc1eo6=XjhAGz8MWKnVDUQKjkU=Kgfu38vRZyLq3XQSxng@mail.gmail.com> <CAAkRFZ+4b81ucyNgPmTFs25wD9Zm-4jcP02W9LWjjB=hQ-TO_A@mail.gmail.com> <CAFiYyc3o8bZjaMv1gZBMQJodSCH9UsWqohZ9Jw3szN+DXFjRgw@mail.gmail.com> <CAAkRFZJ9_yH-A74=aRkX2+zKgegg+SKobqJNu4a0fA7F90hTRg@mail.gmail.com> <CAAkRFZ+YyLKdsT8LSS88rd9-nxVuGrketu+-2C5qPp-98g1_vg@mail.gmail.com> <CAFiYyc0mfhEyPpY_+qv4StNPiatYKcUKz4vxbX=SeWNPCLJEYg@mail.gmail.com> <CAAkRFZJ3BvP3ytzkZgWqSSzkt+Z26n_zMJKEyhM_1KfEi5mCzQ@mail.gmail.com> <CAAiZkiDz5V2Nysn3AA4-GRgw6_eCEM85z6-gZaMLNq9L+B2DbA@mail.gmail.com> <CAAkRFZKhpk-iMppKWSnKX0Q4SLm7-rWrr2D8cWS8iOP4ypMWzw@mail.gmail.com> <CAFiYyc3xm0xYjLAgpzo7q0ovQKJXR4STyoUC=OKLn4XRiTZw6g@mail.gmail.com> <CAKxPW65FKYwpqaB4DnWd+6aS57ZrNoY91rKiX+L-sS2KQ-VFRw@mail.gmail.com> <CAAkRFZLO4rkLnWR067-=+G94F2pnEgX3Z5jXK0mFu545x2EAzA@mail.gmail.com> <CAKxPW65ar+ZdAwYtG5ECnCNYH+Jw+hiyPbXR2_bQ1OoXsr8_Rg@mail.gmail.com> <CAFiYyc37y7Q_z_7vHdZe98s6kKpgTJi4_ehmk=6gVnirV0TFDA@mail.gmail.com> <CAKxPW66yXwtfo_dnpPSudbrTAMOphwdk=KeAR_2U0P1cvKb4Sw@mail.gmail.com> <CAFiYyc3BF-3z3_QdAZxfSe4jupNbb_Ub_nLbjJQ+MisQxGR_CQ@mail.gmail.com> <CAKxPW67rYndb0AuDBpTfij8vB54Txcg4p6Yba693yTpL9=24fg@mail.gmail.com> <CAFiYyc2neYLHce0EUDCBcVKEw4iHAA0rZhEVTWy4+SaiGYPx+A@mail.gmail.com> <CAKxPW67D5EnOvTMJGcntyXG7WwQud2sW0kS3nHenijp6o0JC7g@mail.gmail.com> <CAKxPW67Nn9YSwH_xwFXBM7=y=32s_HpQ4fUAE+E8GoRSsVjxbA@mail.gmail.com> <CAKxPW66cfyabmH-ZbsMtempBCv5zV=embh=WsR18gAVgpDpFMA@mail.gmail.com> <CAAkRFZ+x+Q6E_6DL8w8JyvHZqGVCxiSc8NDRumc9EhUi1vp++Q@mail.gmail.com> <CAKxPW656sVbeVewS6dZL_d7X+02be16JRZ-4mrXkRLzwyuUxkw@mail.gmail.com> <CAFiYyc3AJ1C92QhZHTk83rZPgLSqwk+=qgYDeY9HG-p4UPRrMA@mail.gmail.com> <CAAkRFZJKbNwtA6cJ+sSn5gm1fdX8cr1yoOZz8RFwQd+5aRUQyQ@mail.gmail.com> <CAFiYyc0Q+JdNc3piYNsZvPBkK3GHWbibysn3dRe0=P_Fc6JYVw@mail.gmail.com>
That is a good point. Currently I am making a distinction between dump
flags and opt-info flags, but it is not necessary since the opt-info
flags can be thought of an extension of dump flags.
I will update the patch so that -fdump-tree-vect-optimized also works.
Thanks,
Sharad
On Thu, Sep 13, 2012 at 4:08 AM, Richard Guenther
<richard.guenther@gmail.com> wrote:
> On Wed, Sep 12, 2012 at 6:46 PM, Xinliang David Li <davidxl@google.com> wrote:
>> On Wed, Sep 12, 2012 at 3:30 AM, Richard Guenther
>> <richard.guenther@gmail.com> wrote:
>>> On Wed, Sep 12, 2012 at 10:12 AM, Sharad Singhai <singhai@google.com> wrote:
>>>> Thanks for your comments. Please see my responses inline.
>>>>
>>>> On Tue, Sep 11, 2012 at 1:16 PM, Xinliang David Li <davidxl@google.com> wrote:
>>>>> Can you resend your patch in text form (also need to resolve the
>>>>> latest conflicts) so that it can be commented inline?
>>>>
>>>> I tried to include inline patch earlier but my message was bounced
>>>> back from patches mailing list. I am trying it again.
>>>>
>>>>> Please also provide as summary a more up-to-date description of
>>>>> 1) Command line option syntax and semantics
>>>>
>>>> I added some documentation in the patch. Here are the relevant bits
>>>> from invoke.texi.
>>>>
>>>> `-fdump-tree-SWITCH-OPTIONS=FILENAME'
>>>> Control the dumping at various stages of processing the
>>>> intermediate language tree to a file. The file name is generated
>>>> by appending a switch-specific suffix to the source file name, and
>>>> the file is created in the same directory as the output file. In
>>>> case of `=FILENAME' option, the dump is output on the given file
>>>> instead of the auto named dump files.
>>>> ...
>>>>
>>>> `=FILENAME'
>>>> Instead of an auto named dump file, output into the given file
>>>> name. The file names `stdout' and `stderr' are treated
>>>> specially and are considered already open standard streams.
>>>> For example,
>>>>
>>>> gcc -O2 -ftree-vectorize -fdump-tree-vect-details=foo.dump
>>>> -fdump-tree-pre=stderr file.c
>>>>
>>>> outputs vectorizer dump into `foo.dump', while the PRE dump
>>>> is output on to `stderr'. If two conflicting dump filenames
>>>> are given for the same pass, then the latter option
>>>> overrides the earlier one.
>>>>
>>>> `-fopt-info-PASS'
>>>> `-fopt-info-PASS-OPTIONS'
>>>> `-fopt-info-PASS-OPTIONS=FILENAME'
>>>> Controls optimization dumps from various passes. If the `-OPTIONS'
>>>> form is used, OPTIONS is a list of `-' separated options which
>>>> controls the details of the dump. If OPTIONS is not specified, it
>>>> defaults to `optimized'. If the FILENAME is not specified, it
>>>> defaults to `stderr'. Note that the output FILENAME will be
>>>> overwritten in case of multiple translation units. If a combined
>>>> output from multiple the translation units is desired, `stderr'
>>>> should be used instead.
>>>>
>>>> The PASS could be one of the tree or rtl passes. The following
>>>> options are available
>>>
>>> I don't like that we have -PASS here. That makes it awfully similar
>>> to -fdump-PASS-OPTIONS=FILENAME. Are we merely having
>>> -fopt-info because OPTIONS are "different"?
>>
>>
>> Having PASS is useful to do filtering. But as your said, the option
>> design here is very much oriented towards developers not end users
>> which fopt-info is also intended for.
>
> Just to add a comment here - -fopt-info is _only_ targeted at end users.
> Developers can use -fdump-tree-XXX=stderr now (which, with the correct
> pass / flags should produce identical output to -fopt-info - at least that
> was the whole point with the re-design of the dump API - to make it
> possible to implement -fopt-info in a way that it simply provides a nice
> interface to end-users to our existing dumping information.
>
> If it doesn't work like that right now we should make it work this way.
>
> Richard.