https://gcc.gnu.org/g:775ecdb237d312e82fa5f3bcd6a5b8693249524a

commit r16-3408-g775ecdb237d312e82fa5f3bcd6a5b8693249524a
Author: H.J. Lu <hjl.to...@gmail.com>
Date:   Tue Aug 26 15:56:47 2025 -0700

    Move pr121656.c to gcc.dg/torture
    
    Move pr121656.c to gcc.dg/torture and replace weak attribute with noipa
    attribute.  Verified by reverting
    
    56ca14c4c4f Fix invalid right shift count with recent ifcvt changes
    
    to trigger
    
    FAIL: gcc.dg/torture/pr121656.c   -O1  execution test
    FAIL: gcc.dg/torture/pr121656.c   -O2  execution test
    FAIL: gcc.dg/torture/pr121656.c   -O3 -g  execution test
    FAIL: gcc.dg/torture/pr121656.c   -O2 -flto -fno-use-linker-plugin 
-flto-partition=none  execution test
    
    on Linux/x86-64.
    
            PR tree-optimization/121656
            * gcc.dg/pr121656.c: Moved to ...
            * gcc.dg/torture/pr121656.c: Here.
            (dg-options): Removed.
            (foo): Replace weak attribute with noipa attribute.
    
    Signed-off-by: H.J. Lu <hjl.to...@gmail.com>

Diff:
---
 gcc/testsuite/gcc.dg/pr121656.c         | 21 ---------------------
 gcc/testsuite/gcc.dg/torture/pr121656.c | 30 ++++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 21 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/pr121656.c b/gcc/testsuite/gcc.dg/pr121656.c
deleted file mode 100644
index 00b89418a319..000000000000
--- a/gcc/testsuite/gcc.dg/pr121656.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* { dg-do run } */
-/* { dg-options "-O1" } */
-
-__attribute__ ((weak))
-void
-foo (int b)
-{
-  if (b != 3)
-    __builtin_abort ();
-}
-
-int a;
-int
-main ()
-{
-  int b = 0;
-  if (a >= 0)
-    b += 3;
-  foo (b);
-  return 0;
-}
diff --git a/gcc/testsuite/gcc.dg/torture/pr121656.c 
b/gcc/testsuite/gcc.dg/torture/pr121656.c
new file mode 100644
index 000000000000..343d414b2928
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr121656.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+
+/* This test fails to run at -O1 and above.  This is caused by
+
+   ebbeaf490c5 [PR rtl-optimization/120553] Improve selecting between 
constants based on sign bit test
+
+   and has been fixed by
+
+   56ca14c4c4f Fix invalid right shift count with recent ifcvt changes
+
+ */
+
+__attribute__ ((noipa))
+void
+foo (int b)
+{
+  if (b != 3)
+    __builtin_abort ();
+}
+
+int a;
+int
+main ()
+{
+  int b = 0;
+  if (a >= 0)
+    b += 3;
+  foo (b);
+  return 0;
+}

Reply via email to