On Wed, Oct 27, 2021 at 10:17:39PM -0500, Peter Bergner wrote:
> Sorry for reposting, but I forgot to CC the gcc-patches mailing list. :-(

Whoops, and I replied to your original message :-/

> 2021-10-27  Martin Liska  <mli...@suse.cz>
> 
> gcc/
>       PR target/101324
>       * config/rs6000/rs6000.c (rs6000_option_override_internal): Move the
>       disabling of shrink-wrapping when using -mrop-protect from here...
>       (rs6000_override_options_after_change): ...to here.
> 
> 2021-10-27  Peter Bergner  <berg...@linux.ibm.com>
> 
> gcc/testsuite/
>       PR target/101324
>       * gcc.target/powerpc/pr101324.c: New test.

> +/* Ensure hashst comes after mflr and hashchk comes after ld 0,16(1).  */
> +/* { dg-final { scan-assembler "mflr 0.*hashst 0," } } */
> +/* { dg-final { scan-assembler "ld 0,16\\\(1\\\).*hashchk 0," } } */

First: don't use double quotes, or you get double backslashes (or more)
as well.  Use curlies instead:

/* { dg-final { scan-assembler {ld 0,16\(1\).*hashchk 0,} } } */

But, more importantly, "." by default matches anything, newlines as
well.  You probably do not want that here, because your RE as written
can match an "ld" in one function and a "hashchk" many functions later,
many million lines later.

You can for example do
/* { dg-final { scan-assembler {(?p)ld 0,.*\n.*\mhashchk 0,} } } */

(?p) is "partial newline-sensitive matching": it makes "." not match
newlines.  This is often what you want.  This RE also makes sure that
"hashchk" is the full mnemonic (not the tail of one), and that it is on
the line after that "ld".

Similarly you would have

/* { dg-final { scan-assembler {(?p)\mmflr 0,.*\n.*\mhashst 0,} } } */

I hope I didn't typo those things, I didn't test them out :-)

Okay for trunk with similar robustification.  Thanks!


Segher

Reply via email to