From: Jeff Law <law@redhat.com>
To: Thomas Schwinge <thomas@codesourcery.com>,
David Malcolm <dmalcolm@redhat.com>,
gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] dumpfile.c: use prefixes other that 'note: ' for MSG_{OPTIMIZED_LOCATIONS|MISSED_OPTIMIZATION}
Date: Fri, 13 Nov 2020 15:06:24 -0700 [thread overview]
Message-ID: <c0b3dd80-5357-5236-219d-2753d85b0d84@redhat.com> (raw)
In-Reply-To: <87r1p6ev7q.fsf@euler.schwinge.homeip.net>
On 11/6/20 1:38 AM, Thomas Schwinge wrote:
> Hi!
>
> On 2018-09-25T16:00:14-0400, David Malcolm <dmalcolm@redhat.com> wrote:
>> As noted at Cauldron, dumpfile.c currently emits "note: " for all kinds
>> of dump message, so that (after filtering) there's no distinction between
>> MSG_OPTIMIZED_LOCATIONS vs MSG_NOTE vs MSG_MISSED_OPTIMIZATION in the
>> textual output.
>>
>> This patch changes dumpfile.c so that the "note: " varies to show
>> which MSG_* was used, with the string prefix matching that used for
>> filtering in -fopt-info, hence e.g.
>> directive_unroll_3.f90:24:0: optimized: loop unrolled 7 times
>> and:
>> pr19210-1.c:24:3: missed: missed loop optimization: niters analysis ends up with assumptions.
>>
>> The patch adds "dg-optimized" and "dg-missed" directives for use
>> in the testsuite for matching these (with -fopt-info on stderr; they
>> don't help for dumpfile output).
> Thanks, this is very useful.
>
>
> I just ran into a problem regarding these two:
>
>> --- a/gcc/testsuite/lib/gcc-dg.exp
>> +++ b/gcc/testsuite/lib/gcc-dg.exp
>> +# Handle output from -fopt-info for MSG_OPTIMIZED_LOCATIONS:
>> +# a successful optimization.
>> +
>> +proc dg-optimized { args } {
>> + # Make this variable available here and to the saved proc.
>> + upvar dg-messages dg-messages
>> +
>> + process-message saved-dg-error "optimized: " "$args"
>> +}
>> +
>> +# Handle output from -fopt-info for MSG_MISSED_OPTIMIZATION:
>> +# a missed optimization.
>> +
>> +proc dg-missed { args } {
>> + # Make this variable available here and to the saved proc.
>> + upvar dg-messages dg-messages
>> +
>> + process-message saved-dg-error "missed: " "$args"
>> +}
> If, in addition to the usual line location checking, you'd like to do
> column location checking ("[column]: " prefix before the actual
> diagnostic), and the actual diagnostic doesn't begin with whitespace,
> then this currently fails. To address this, OK to push the attached
> patch "[testsuite] Enable column location checking for 'dg-optimized',
> 'dg-missed'" -- with or without the demonstrator
> 'gcc.dg/vect/nodump-vect-opt-info-1.c',
> 'gcc.dg/vect/nodump-vect-opt-info-2.c' changes, your call? (I still have
> to run this through regression testing.)
>
>
> Grüße
> Thomas
>
>
> -----------------
> Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
> Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
>
> 0001-testsuite-Enable-column-location-checking-for-dg-opt.patch
>
> From f3046b8bea6a2a6489dd10d72cb038b92aa4fc38 Mon Sep 17 00:00:00 2001
> From: Thomas Schwinge <thomas@codesourcery.com>
> Date: Fri, 6 Nov 2020 09:18:06 +0100
> Subject: [PATCH] [testsuite] Enable column location checking for
> 'dg-optimized', 'dg-missed'
>
> 'process-message' would like the 'msgprefix' argument without trailing space.
>
> This is a bug-fix for commit ed2d9d3720adef3a260b8a55e17e744352a901fc
> "dumpfile.c: use prefixes other than 'note: ' for
> MSG_{OPTIMIZED_LOCATIONS|MISSED_OPTIMIZATION}", which added 'dg-optimized',
> 'dg-missed'.
>
> gcc/testsuite/
> * lib/gcc-dg.exp (dg-optimized, dg-missed): Fix 'process-message'
> call.
> * gcc.dg/vect/nodump-vect-opt-info-1.c: Demonstrate.
> * gcc.dg/vect/nodump-vect-opt-info-2.c: Likewise.
OK
jeff
next prev parent reply other threads:[~2020-11-13 22:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-25 21:55 David Malcolm
2018-09-28 9:44 ` Richard Biener
2018-09-29 23:06 ` Andreas Schwab
2018-10-01 14:20 ` David Malcolm
2018-10-01 14:29 ` Andreas Schwab
2018-10-04 11:34 ` Rainer Orth
2018-12-05 13:57 ` Rainer Orth
2020-11-06 8:38 ` Thomas Schwinge
2020-11-13 22:06 ` Jeff Law [this message]
2020-11-24 9:46 ` Thomas Schwinge
2020-11-06 8:50 ` Thomas Schwinge
2020-11-13 22:06 ` Jeff Law
2020-11-24 9:51 ` Thomas Schwinge
2020-11-06 9:26 ` Add 'dg-note' next to 'dg-optimized', 'dg-missed' (was: [PATCH] dumpfile.c: use prefixes other that 'note: ' for MSG_{OPTIMIZED_LOCATIONS|MISSED_OPTIMIZATION}) Thomas Schwinge
2020-11-24 9:53 ` Thomas Schwinge
2020-11-30 19:28 ` Jeff Law
2021-05-18 10:46 ` Add 'dg-note', 'dg-lto-note' (was: Add 'dg-note' next to 'dg-optimized', 'dg-missed') Thomas Schwinge
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=c0b3dd80-5357-5236-219d-2753d85b0d84@redhat.com \
--to=law@redhat.com \
--cc=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=thomas@codesourcery.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).