public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-8108] arm: fix testsuite failure of reg_equal_test.c [PR101755]
@ 2022-04-12 12:39 Richard Earnshaw
  0 siblings, 0 replies; only message in thread
From: Richard Earnshaw @ 2022-04-12 12:39 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:62082d278d1fc9773539244194061ab32556db4d

commit r12-8108-g62082d278d1fc9773539244194061ab32556db4d
Author: Richard Earnshaw <rearnsha@arm.com>
Date:   Tue Apr 12 13:35:27 2022 +0100

    arm: fix testsuite failure of reg_equal_test.c [PR101755]
    
    The test failure in PR101755 is due to the gimple optimizers getting
    smarter.  But really we are just testing that RTL expansion is doing
    the right thing and annotating a constant accordingly.  So rework the
    test to use GIMPLE input and simplify the code entirely.  Also, this
    test only ever worked on architecture versions with the MOVW/MOVT
    instructions, so check for this before running.
    
    gcc/testsuite/ChangeLog:
    
            PR target/101755
            * gcc.target/arm/reg_equal_test.c: Convert to gimple test.  Restrict
            to architectures with MOVW/MOVT.

Diff:
---
 gcc/testsuite/gcc.target/arm/reg_equal_test.c | 25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)

diff --git a/gcc/testsuite/gcc.target/arm/reg_equal_test.c b/gcc/testsuite/gcc.target/arm/reg_equal_test.c
index 58fa9dd9b94..d87c75cc27c 100644
--- a/gcc/testsuite/gcc.target/arm/reg_equal_test.c
+++ b/gcc/testsuite/gcc.target/arm/reg_equal_test.c
@@ -1,24 +1,15 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-rtl-expand" } */
+/* { dg-options "-fgimple -O1 -fdump-rtl-expand" } */
+/* { dg-skip-if "" { ! { arm_thumb2_ok || arm_thumb1_movt_ok } } } */
 
-extern void abort (void);
-unsigned int a = 1;
-
-int
-main (void)
+void __GIMPLE (ssa,startwith ("expand"))
+x ()
 {
-  unsigned int b, c, d;
-
-  if (sizeof (int) != 4 || (int) 0xc7d24b5e > 0)
-    return 0;
-
-  c = 0xc7d24b5e;
-  d = a | -2;
-  b = (d == 0) ? c : (c % d);
-  if (b != c)
-    abort ();
+  unsigned int d;
 
-  return 0;
+  __BB(2,guessed_local(1073741824)):
+  d_1 = 3352447838u;
+  return;
 }
 
 /* { dg-final { scan-rtl-dump "expr_list:REG_EQUAL \\(const_int -942519458" "expand" } } */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-12 12:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-12 12:39 [gcc r12-8108] arm: fix testsuite failure of reg_equal_test.c [PR101755] Richard Earnshaw

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