]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR sanitizer/64078 (FAIL: c-c++-common/ubsan/object-size-9.c)
authorTom de Vries <tom@codesourcery.com>
Mon, 29 Aug 2016 07:57:16 +0000 (07:57 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Mon, 29 Aug 2016 07:57:16 +0000 (07:57 +0000)
2016-08-29  Tom de Vries  <tom@codesourcery.com>

backport from trunk:
2015-09-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>

PR sanitizer/64078
* c-c++-common/ubsan/object-size-9.c (s): Add alignment attribute.
(f2, f3): Make the function static.
* c-c++-common/ubsan/object-size-10.c (a, b): Add alignment attribute.

From-SVN: r239816

gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/ubsan/object-size-10.c
gcc/testsuite/c-c++-common/ubsan/object-size-9.c

index e0c9ed6337fe3faf20fc70a6e9f0596c4c9e748d..82551ef68f2f152387dd4073a3e2045b66a5d904 100644 (file)
@@ -1,3 +1,13 @@
+2016-08-29  Tom de Vries  <tom@codesourcery.com>
+
+       backport from trunk:
+       2015-09-17  Bernd Edlinger  <bernd.edlinger@hotmail.de>
+
+       PR sanitizer/64078
+       * c-c++-common/ubsan/object-size-9.c (s): Add alignment attribute.
+       (f2, f3): Make the function static.
+       * c-c++-common/ubsan/object-size-10.c (a, b): Add alignment attribute.
+
 2016-08-29  Tom de Vries  <tom@codesourcery.com>
 
        backport from trunk:
index ebc8582ec3cf7717834e8cbe7941273868db3c89..8aa00bfc14e6369d49f7c50ffc152a0de8072ff8 100644 (file)
@@ -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 829c822959228d5e4c9f0f784b59684bcb195c3b..e718020d08ea2d44eb64632b92ab40e210f6d21f 100644 (file)
@@ -11,7 +11,7 @@ struct C { C () : d("abcdefg"), e(1) {} C (const C &x) { __builtin_memcpy (d, x.
 #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 @@ f1 (struct T x, int i)
 /* { dg-output "\[^\n\r]*\\^\[^\n\r]*(\n|\r\n|\r)" } */
 
 #ifdef __cplusplus
-struct C
+static struct C
 f2 (int i)
 {
   struct C x;
@@ -41,7 +41,7 @@ f2 (int i)
 /* { 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
+static struct C
 f3 (int i)
 {
   struct C x;