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

commit r15-7321-ge8262c9041feddd7446840a9532cf458452f3587
Author: H.J. Lu <hjl.to...@gmail.com>
Date:   Sun Feb 2 06:46:29 2025 +0800

    x86: Add a test for PR rtl-optimization/111673
    
    Add a test for the target independent bug, PR rtl-optimization/111673.
    
            PR rtl-optimization/111673
            * gcc.target/i386/pr111673.c: New file.
    
    Signed-off-by: H.J. Lu <hjl.to...@gmail.com>

Diff:
---
 gcc/testsuite/gcc.target/i386/pr111673.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/gcc/testsuite/gcc.target/i386/pr111673.c 
b/gcc/testsuite/gcc.target/i386/pr111673.c
new file mode 100644
index 000000000000..8d8a5a764f00
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr111673.c
@@ -0,0 +1,17 @@
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O2 -fdump-rtl-pro_and_epilogue" } */
+
+/* Verify there is an early return without the prolog and shrink-wrap
+   the function. */
+
+int f (int);
+int
+advance (int dz)
+{
+  if (dz > 0)
+    return (dz + dz) * dz;
+  else
+    return dz * f (dz);
+}
+
+/* { dg-final { scan-rtl-dump-times "Performing shrink-wrapping" 1 
"pro_and_epilogue" } } */

Reply via email to