-mno-long-calls for arm/headmerge tests
commit02d2706db342613bf81cf41c3cf89998022d13d4
authorAlexandre Oliva <oliva@adacore.com>
Fri, 1 Jan 2021 00:38:23 +0000 (31 21:38 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Fri, 1 Jan 2021 04:39:49 +0000 (1 01:39 -0300)
treee92b6f31d03959f58d2af39231c42502ca617ec4
parentfe0e54c69fc0c07144ce7e8710c29162053430b3
-mno-long-calls for arm/headmerge tests

The headmerge tests pass a constant to conditional calls, so that the
same constant is always passed to a function, though it's a different
function depending on which path is taken.

The test checks that the constant appears only once in the assembly
output, as a means to verify that the insns setting up the argument
are unified: they appear as separate insns up to jump2, where
crossjump identifies a common prefix to all conditional paths and
unifies them.

Alas, with -mlong-calls, that we enable in our arm-vxworks
configurations, the argument register is loaded after loading the
callee address into another register.  Since each path calls a
different function, there's no common initial code sequence for
crossjump to unify, and the argument register set up remains separate,
so the test fails.

Though it would surely be desirable for the compiler to perform the
unification of the argument register setting up, this patch merely
avoids the effects of -mlong-calls, with an explicit -mno-long-calls.

for  gcc/testsuite/ChangeLog

* gcc.target/arm/headmerge-1.c: Add -mno-long-calls.
* gcc.target/arm/headmerge-2.c: Likewise.
gcc/testsuite/gcc.target/arm/headmerge-1.c
gcc/testsuite/gcc.target/arm/headmerge-2.c