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

commit r17-6685-ge5d0ea3ffd72398ffb410cd646814fadc48c2625
Author: Jakub Jelinek <[email protected]>
Date:   Wed Nov 25 13:25:44 2026 +0100

    testsuite: Fix up tree-ssa/forwprop-{45,46}.c tests
    
    On Tue, Nov 24, 2026 at 10:15:57AM -0700, Jeff Law wrote:
    > > >   * gcc.dg/tree-ssa/forwprop-45.c: New test.
    > > >   * gcc.dg/tree-ssa/forwprop-46.c: New test.
    
    The 2 tests unfortunately FAIL on i686-linux:
    FAIL: gcc.dg/tree-ssa/forwprop-45.c (test for excess errors)
    Excess errors:
    /home/jakub/src/gcc/gcc/testsuite/gcc.dg/tree-ssa/forwprop-45.c:13:1: 
warning: SSE vector return without SSE enabled changes the ABI [-Wpsabi]
    PASS: gcc.dg/tree-ssa/forwprop-45.c scan-tree-dump-not optimized 
"BIT_INSERT_EXPR"
    gcc.dg/tree-ssa/forwprop-45.c: pattern found 0 times
    FAIL: gcc.dg/tree-ssa/forwprop-45.c scan-tree-dump-times optimized "= 
{c_[0-9]+\\(D\\), c_[0-9]+\\(D\\), c_[0-9]+\\(D\\), c_[0-9]+\\(D\\)}" 2
    gcc.dg/tree-ssa/forwprop-45.c: pattern found 0 times
    FAIL: gcc.dg/tree-ssa/forwprop-45.c scan-tree-dump-times optimized "= 
{a_[0-9]+\\(D\\), b_[0-9]+\\(D\\), c_[0-9]+\\(D\\), d_[0-9]+\\(D\\)}" 2
    FAIL: gcc.dg/tree-ssa/forwprop-45.c scan-tree-dump optimized "= [{]1, 
a_[0-9]+\\(D\\), 3, b_[0-9]+\\(D\\)}"
    FAIL: gcc.dg/tree-ssa/forwprop-45.c scan-tree-dump optimized "= 
{c_[0-9]+\\(D\\), a_[0-9]+\\(D\\), b_[0-9]+\\(D\\), a_[0-9]+\\(D\\)}"
    FAIL: gcc.dg/tree-ssa/forwprop-46.c (test for excess errors)
    Excess errors:
    /home/jakub/src/gcc/gcc/testsuite/gcc.dg/tree-ssa/forwprop-46.c:14:6: 
warning: SSE vector argument without SSE enabled changes the ABI [-Wpsabi]
    
    forwprop-46.c just needs -Wno-psabi, that is easy and quite obvious.
    forwprop-45.c is more complicated, it needs a target with 16-byte
    vector int or float support, but vect_int and vect_float effective
    targets are meant for use in vect.exp where some flags are added implicitly
    for certain targets.  So, this patch instead just guards the
    scan-tree-dump* on a list of known good targets, adds -Wno-psabi to
    dg-options and -msse2 as dg-additional-options for ia32.
    
    2026-11-25  Jakub Jelinek  <[email protected]>
    
            * gcc.dg/tree-ssa/forwprop-45.c: Add -Wno-psabi to dg-options.  Add
            -msse2 as dg-additional-options for ia32.  Guard 
scan-tree-dump{,-times}
            on x86 or aarch64 as known targets supporting vectors.
            * gcc.dg/tree-ssa/forwprop-46.c: Add -Wno-psabi to dg-options.
    
    Reviewed-by: Richard Biener <[email protected]>

Diff:
---
 gcc/testsuite/gcc.dg/tree-ssa/forwprop-45.c | 11 ++++++-----
 gcc/testsuite/gcc.dg/tree-ssa/forwprop-46.c |  2 +-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-45.c 
b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-45.c
index b38f0fa2e75c..3dbf41b38660 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-45.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-45.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-options "-O2 -Wno-psabi -fdump-tree-optimized" } */
+/* { dg-additional-options "-msse2" { target ia32 } } */
 
 /* A chain of BIT_INSERT_EXPRs that writes every element of a vector, or
    that starts from a constant or a CONSTRUCTOR, is turned into a single
@@ -59,7 +60,7 @@ partial_ctor (int a, int b, int c)
 }
 
 /* { dg-final { scan-tree-dump-not "BIT_INSERT_EXPR" "optimized" } } */
-/* { dg-final { scan-tree-dump-times "= {c_\[0-9\]+\\(D\\), c_\[0-9\]+\\(D\\), 
c_\[0-9\]+\\(D\\), c_\[0-9\]+\\(D\\)}" 2 "optimized" } } */
-/* { dg-final { scan-tree-dump-times "= {a_\[0-9\]+\\(D\\), b_\[0-9\]+\\(D\\), 
c_\[0-9\]+\\(D\\), d_\[0-9\]+\\(D\\)}" 2 "optimized" } } */
-/* { dg-final { scan-tree-dump "= \[{\]1, a_\[0-9\]+\\(D\\), 3, 
b_\[0-9\]+\\(D\\)}" "optimized" } } */
-/* { dg-final { scan-tree-dump "= {c_\[0-9\]+\\(D\\), a_\[0-9\]+\\(D\\), 
b_\[0-9\]+\\(D\\), a_\[0-9\]+\\(D\\)}" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= {c_\[0-9\]+\\(D\\), c_\[0-9\]+\\(D\\), 
c_\[0-9\]+\\(D\\), c_\[0-9\]+\\(D\\)}" 2 "optimized" { target { i?86-*-* 
x86_64-*-* aarch64-*-* } } } } */
+/* { dg-final { scan-tree-dump-times "= {a_\[0-9\]+\\(D\\), b_\[0-9\]+\\(D\\), 
c_\[0-9\]+\\(D\\), d_\[0-9\]+\\(D\\)}" 2 "optimized" { target { i?86-*-* 
x86_64-*-* aarch64-*-* } }  } } */
+/* { dg-final { scan-tree-dump "= \[{\]1, a_\[0-9\]+\\(D\\), 3, 
b_\[0-9\]+\\(D\\)}" "optimized" { target { i?86-*-* x86_64-*-* aarch64-*-* } }  
} } */
+/* { dg-final { scan-tree-dump "= {c_\[0-9\]+\\(D\\), a_\[0-9\]+\\(D\\), 
b_\[0-9\]+\\(D\\), a_\[0-9\]+\\(D\\)}" "optimized" { target { i?86-*-* 
x86_64-*-* aarch64-*-* } }  } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-46.c 
b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-46.c
index 7e3837f985b1..fb32bfec6df7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-46.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/forwprop-46.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-O2 -Wno-psabi" } */
 
 /* A single insert into a one-element vector overwrites the whole vector,
    it used to ICE in simple_dce_from_worklist when the vector was a

Reply via email to