tighten funcspec regexps
authorAlexandre Oliva <oliva@adacore.com>
Wed, 24 Mar 2021 08:44:36 +0000 (05:44 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Wed, 24 Mar 2021 08:44:36 +0000 (05:44 -0300)
commitd42ab6885a46d73903643c24a4f65fbf28dd0ec2
treee178b5698fab10916a5a29baa33e7990539be1af
parent4be312862dec5c8e49c76249dd5aed220c72039e
tighten funcspec regexps

In -mcmodel=large, callee symbols are pulled ahead of the call insns.

The patterns in funcspec-[12].c tests in gcc.target/i386 match even
line breaks between 'call' and a function symbol expected to be
called, however, so it ends up unexpectedly matching a previous,
unrelated indirect call, up to the insn that loads the address of the
intended callee to a register, for all but the first callee, that
doesn't have a call insn before it.

All of these apparent passes are false positives.  We are NOT
generating the expected call insns.

This patch fixes only the patterns, so that they won't trigger false
positives any more.  There are several dozens of other tests that fail
with -mcmodel=large for similar reasons, but I'm still not sure about
how to deal with them.  I see no point in holding up this small
improvement over the lack of a larger solution of a different problem,
though.

for  gcc/testsuite/ChangeLog

* gcc.target/i386/funcspec-2.c: Tighten regexps to avoid false
positives with -mcmodel=large.
* gcc.target/i386/funcspec-3.c: Likewise.
gcc/testsuite/gcc.target/i386/funcspec-2.c
gcc/testsuite/gcc.target/i386/funcspec-3.c