public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joern Rennecke <joern.rennecke@embecosm.com>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: Vineet Gupta <vineetg@rivosinc.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: committed [RISC-V]: Harden test scan patterns
Date: Sat, 30 Sep 2023 22:12:09 +0100	[thread overview]
Message-ID: <CAMqJFCpfPUwh-617MJCEBb=cxf7561QHRthbL3cHxcdK2YrfbQ@mail.gmail.com> (raw)
In-Reply-To: <de80edfb-caa2-45d2-b67b-9f421a5421de@gmail.com>

On Fri, 29 Sept 2023 at 14:54, Jeff Law <jeffreyalaw@gmail.com> wrote:

> So I recommend we go forward with Joern's approach (so consider that an
> ACK for the trunk).   Joern  can you post a follow-up manual twiddle so
> that other ports can follow your example and avoid this problem?

The manual... so not in the general web pages, but the stuff under gcc/doc ?
I see that we have a description of scan-assembler* directives in
sourcebuild.texi ,
so I suppose that it should go there.  I suppose the advice should also apply to
scan-assembler-dem(-not), but not to scan-symbol-section .

The more I think about this, the more it feels like we are providing the wrong
tools and then are telling users they're using it incorrectly
(like "You're holding it wrong.").
Quoting dots with \. is not much of an issue, but prepending \t or \m
impairs legibility.  I like the obsoleted word-start/end markers \< / \>
much better, as they don't blend in with text.
^ as start-of-line marker is nice for legibility, but it will generally not
work with common semantics, as it'll be thrown off by white space,
and even more, by labels.

Also, we might have different directives for not scanning in LTO sections -
or just ignoring .ascii .  Or maybe the other way round - you have to do
something special if you want to scan inside strings, and by default we
don't look inside strings?
LTO information uses ascii, and ISTR sometimes also a zero-terminated
variant (asciiz?); There might also some string constant outputs, or stabs
information.
One possible rule I think might work is: if the RE doesn't mention a quote,
don't scan what's quoted inside double quotes.  Although we might to have
to look out for backslash-escaped quotes to find the proper end of a quoted
string.

Or should we instead make assembly scans specific to sections in which
assembly output goes, like text sections?  The danger is that we might miss
a text section by another name.  We can give an error if we find no text
section, but there might be a recognizable text section which is a red
herring besides the one that's hidden by some unusual name.

  reply	other threads:[~2023-09-30 21:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27  9:26 Joern Rennecke
2023-09-27 17:22 ` Jeff Law
2023-09-27 18:22   ` Joern Rennecke
2023-09-27 20:14     ` Jeff Law
2023-09-27 22:12       ` Andrew Pinski
2023-09-27 23:21       ` Vineet Gupta
2023-09-29 13:54         ` Jeff Law
2023-09-30 21:12           ` Joern Rennecke [this message]
2023-10-11  4:48             ` Joern Rennecke
2023-10-11  7:12               ` Joern Rennecke
2023-11-08 15:14               ` Joern Rennecke
2023-11-08 16:00           ` RFA: make scan-assembler* ignore LTO sections (Was: Re: committed [RISC-V]: Harden test scan patterns) Joern Rennecke
2023-11-10  6:02             ` Jeff Law

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='CAMqJFCpfPUwh-617MJCEBb=cxf7561QHRthbL3cHxcdK2YrfbQ@mail.gmail.com' \
    --to=joern.rennecke@embecosm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=vineetg@rivosinc.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).