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>
---
OK? Fails with that commit reverted.

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

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" } } */

base-commit: 127a24ede2f82eafecb5eb142e21dbda38d06c18
-- 
2.49.0

Reply via email to