public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andre Vieira <Andre.SimoesDiasVieira@arm.com>
To: Marek Polacek <polacek@redhat.com>,  David Malcolm <dmalcolm@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Location of "dg-final" directives? (was Re: [PATCH][GCC] Algorithmic optimization in match and simplify)
Date: Wed, 02 Sep 2015 13:24:00 -0000	[thread overview]
Message-ID: <55E6F876.3030406@arm.com> (raw)
In-Reply-To: <20150901165459.GH29304@redhat.com>



On 01/09/15 17:54, Marek Polacek wrote:
> On Tue, Sep 01, 2015 at 12:50:27PM -0400, David Malcolm wrote:
>> I can't comment on the patch itself, but I noticed that in the testsuite
>> addition, you've gathered all the "dg-final" clauses at the end.
>>
>> I think that this is consistent with existing practice in gcc, but
>> AFAIK, the dg-final clauses can appear anywhere in the file.
>>
>> Would it make test cases more readable if we put the dg-final clauses
>> next to the code that they relate to?  Or, at least after the function
>> that they relate to?
>>
>> For example:
>>
>>    unsigned short
>>    foo (unsigned short a)
>>    {
>>      a ^= 0x4002;
>>      a >>= 1;
>>      a |= 0x8000; /* Simplify to ((a >> 1) ^ 0xa001).  */
>>      return a;
>>    }
>>    /* { dg-final { scan-tree-dump "\\^ 40961" "forwprop1" } } */
>>
>>    unsigned short
>>    bar (unsigned short a)
>>    {
>>        /* snip */ /* Simplify to ((a << 1) | 0x8005).  */
>>    }
>>    /* { dg-final { scan-tree-dump "\\| 32773" "forwprop1" } } */
>>
>>    ... etc ...
>>
>> I think this may be more readable than the "group them all at the end of
>> the file approach", especially with testcases with many files and
>> dg-final directives.
>
> Yeah, it's probably somewhat more readable.  Same for dg-output.  E.g. some
> ubsan tests already use dg-outputs after functions they relate to.
>
> 	Marek
>

If no one objects Ill make those changes too. Sounds reasonable to me.

Andre

      reply	other threads:[~2015-09-02 13:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-28 17:29 [PATCH][GCC] Algorithmic optimization in match and simplify Andre Vieira
2015-08-28 18:13 ` Marc Glisse
2015-09-01 13:40   ` Andre Vieira
2015-09-01 14:01     ` Richard Biener
2015-09-03 11:13       ` [PATCH v2][GCC] " Andre Vieira
2015-09-16 14:23         ` Andre Vieira
2015-09-17  9:52         ` Richard Biener
2015-09-25 11:44           ` Andre Vieira
2015-09-25 12:22             ` Richard Biener
2015-10-07  8:21               ` [PATCH V3][GCC] " Andre Vieira
2015-10-08 12:29                 ` Richard Biener
2015-10-09 16:11                   ` James Greenhalgh
2015-10-15 13:50                     ` Christophe Lyon
2015-10-19 11:49                       ` Richard Biener
2015-09-01 16:50 ` Location of "dg-final" directives? (was Re: [PATCH][GCC] Algorithmic optimization in match and simplify) David Malcolm
2015-09-01 16:55   ` Marek Polacek
2015-09-02 13:24     ` Andre Vieira [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55E6F876.3030406@arm.com \
    --to=andre.simoesdiasvieira@arm.com \
    --cc=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=polacek@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).