public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] -mno-long-calls for arm/headmerge tests
@ 2021-01-01  1:30 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2021-01-01  1:30 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:f303ebb797726bab0dba80f2bce7d5d153619fa9

commit f303ebb797726bab0dba80f2bce7d5d153619fa9
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Dec 31 21:38:23 2020 -0300

    -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.

Diff:
---
 gcc/testsuite/gcc.target/arm/headmerge-1.c | 2 +-
 gcc/testsuite/gcc.target/arm/headmerge-2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/headmerge-1.c b/gcc/testsuite/gcc.target/arm/headmerge-1.c
index 218c6a21ebd..319ccd25462 100644
--- a/gcc/testsuite/gcc.target/arm/headmerge-1.c
+++ b/gcc/testsuite/gcc.target/arm/headmerge-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile }  */
-/* { dg-options "-O2" }  */
+/* { dg-options "-O2 -mno-long-calls" }  */
 /* { dg-final { scan-assembler-times "#120" 1 } } */
 
 extern void foo1 (int);
diff --git a/gcc/testsuite/gcc.target/arm/headmerge-2.c b/gcc/testsuite/gcc.target/arm/headmerge-2.c
index 17d8e9365c5..a015eb0f569 100644
--- a/gcc/testsuite/gcc.target/arm/headmerge-2.c
+++ b/gcc/testsuite/gcc.target/arm/headmerge-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile }  */
-/* { dg-options "-O2" }  */
+/* { dg-options "-O2 -mno-long-calls" }  */
 /* { dg-final { scan-assembler-times "120\n" 1 } } */
 
 extern void foo1 (int);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] -mno-long-calls for arm/headmerge tests
@ 2020-12-25  1:47 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2020-12-25  1:47 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d0dbbf173bf66757fbf7d640fdbc037fcfc9bc5d

commit d0dbbf173bf66757fbf7d640fdbc037fcfc9bc5d
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Dec 24 22:43:37 2020 -0300

    -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.

Diff:
---
 gcc/testsuite/gcc.target/arm/headmerge-1.c | 2 +-
 gcc/testsuite/gcc.target/arm/headmerge-2.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/headmerge-1.c b/gcc/testsuite/gcc.target/arm/headmerge-1.c
index 218c6a21ebd..319ccd25462 100644
--- a/gcc/testsuite/gcc.target/arm/headmerge-1.c
+++ b/gcc/testsuite/gcc.target/arm/headmerge-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile }  */
-/* { dg-options "-O2" }  */
+/* { dg-options "-O2 -mno-long-calls" }  */
 /* { dg-final { scan-assembler-times "#120" 1 } } */
 
 extern void foo1 (int);
diff --git a/gcc/testsuite/gcc.target/arm/headmerge-2.c b/gcc/testsuite/gcc.target/arm/headmerge-2.c
index 17d8e9365c5..a015eb0f569 100644
--- a/gcc/testsuite/gcc.target/arm/headmerge-2.c
+++ b/gcc/testsuite/gcc.target/arm/headmerge-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile }  */
-/* { dg-options "-O2" }  */
+/* { dg-options "-O2 -mno-long-calls" }  */
 /* { dg-final { scan-assembler-times "120\n" 1 } } */
 
 extern void foo1 (int);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-01  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01  1:30 [gcc(refs/users/aoliva/heads/testme)] -mno-long-calls for arm/headmerge tests Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2020-12-25  1:47 Alexandre Oliva

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).