https://gcc.gnu.org/g:4cac3f83c2b31ab352f537368e4efdadd5c47a9a

commit r15-8916-g4cac3f83c2b31ab352f537368e4efdadd5c47a9a
Author: Sam James <s...@gentoo.org>
Date:   Tue Mar 25 07:47:27 2025 +0000

    testsuite: add testcase for recent alias fix
    
    r15-7961-gdc47161c1f32c3 fixes a typo in ao_compare::compare_ao_refs
    but there wasn't a testcase available at the time. Now there is.
    
    Thanks to Andrew for the testcase.
    
    gcc/testsuite/ChangeLog:
            PR testsuite/119382
    
            * gcc.dg/ipa/ipa-icf-40.c: New test.
    
    Co-authored-by: Andrew Pinski <quic_apin...@quicinc.com>

Diff:
---
 gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c 
b/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c
new file mode 100644
index 000000000000..ab328ba33412
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-40.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-ipa-icf-optimized" } */
+
+int c0 = 0;
+typedef int v4si __attribute__((vector_size(4*sizeof(int))));
+v4si a;
+int f()
+{
+        return a[c0];
+}
+int g()
+{
+        return a[c0];
+}
+
+/* { dg-final { scan-ipa-dump "optimized: Semantic equality 
hit:f/\[0-9+\]+->g/\[0-9+\]+" "icf" } } */

Reply via email to