Index: gcc/testsuite/c-c++-common/ubsan/object-size-10.c
===================================================================
--- gcc/testsuite/c-c++-common/ubsan/object-size-10.c	(revision 224345)
+++ gcc/testsuite/c-c++-common/ubsan/object-size-10.c	(working copy)
@@ -2,8 +2,8 @@
 /* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
 /* { dg-options "-fsanitize=undefined" } */
 
-static char a[128];
-static int b[128];
+static char a[128] __attribute__ ((aligned(4096)));
+static int b[128] __attribute__ ((aligned(4096)));
 
 __attribute__ ((noinline, noclone)) int
 fn1 (int i)
Index: gcc/testsuite/c-c++-common/ubsan/object-size-9.c
===================================================================
--- gcc/testsuite/c-c++-common/ubsan/object-size-9.c	(revision 224345)
+++ gcc/testsuite/c-c++-common/ubsan/object-size-9.c	(working copy)
@@ -11,7 +11,7 @@
 #endif
 struct U { int a : 5; int b : 19; int c : 8; };
 struct S { struct U d[10]; };
-struct S s;
+struct S s __attribute__ ((aligned(4096)));
 
 int
 f1 (struct T x, int i)
@@ -27,7 +27,7 @@
 /* { dg-output "\[^\n\r]*\\^\[^\n\r]*(\n|\r\n|\r)" } */
 
 #ifdef __cplusplus
-struct C
+inline struct C
 f2 (int i)
 {
   struct C x;
@@ -41,7 +41,7 @@
 /* { dg-output "\[^\n\r]*\[^\n\r]*(\n|\r\n|\r)" { target { c++ } } } */
 /* { dg-output "\[^\n\r]*\\^\[^\n\r]*(\n|\r\n|\r)" { target { c++ } } } */
 
-struct C
+inline struct C
 f3 (int i)
 {
   struct C x;
