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_apinski@quicinc.com>
--- /dev/null
+/* { 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" } } */