diff mbox series

Avoid g++.dg/lto/alias-4_0.C test failure on ARM [PR91322]

Message ID 20200409121529.GA63149@kam.mff.cuni.cz
State New
Headers show
Series Avoid g++.dg/lto/alias-4_0.C test failure on ARM [PR91322] | expand

Commit Message

Jan Hubicka April 9, 2020, 12:15 p.m. UTC
Hi,
this patch avoid failure of alias-4_0.C testcase. The testcase is
testing that ODR TBAA works but structure used conflicts with builtin
va_arg type on ARM which disables TBAA for it.

Better fix would be to make va_arg types with mangled names in
lto1 frontend but that require some extra work, so it is next stage1
material.

I thus comitted the following.
Honza

2020-04-09  Jan Hubicka  <hubicka@ucw.cz>

	PR tree-optimization/91322
	* g++.dg/lto/alias-4_0.C: Avoid conflict with va_list on ARM and add
	a template testing that.
diff mbox series

Patch

diff --git a/gcc/testsuite/g++.dg/lto/alias-4_0.C b/gcc/testsuite/g++.dg/lto/alias-4_0.C
index 410c3140baf..3d386324753 100644
--- a/gcc/testsuite/g++.dg/lto/alias-4_0.C
+++ b/gcc/testsuite/g++.dg/lto/alias-4_0.C
@@ -1,11 +1,14 @@ 
 /* { dg-lto-do run } */
-/* { dg-lto-options { { -O3 -flto -fno-early-inlining } } } */
+/* { dg-lto-options { { -O3 -flto -fno-early-inlining -fdump-ipa-cgraph} } } */
 __attribute__ ((used))
 short *ptr_init, **ptr=&ptr_init;
 
 __attribute__ ((used))
 struct a {
   int *aptr;
+  /* On ARM va_list is an anonymous structure containing pointer. 
+     This disable ODR TBAA on it.  */
+  short b;
 } a, *aptr=&a;
 
 void
@@ -29,3 +32,6 @@  main()
   test ();
   return 0;
 }
+/* On ARM the testcase used to fial because struct a got in conflict with builtin
+   va_list type.  Check that this does not happen.  */
+/* { dg-final { scan-wpa-ipa-dump-not "ODR and non-ODR type conflict" "cgraph"  } } */