* c-c++-common/ubsan/bounds-2.c (fn4): Adjust to check the array size
in the structure.
From-SVN: r212933
+2014-07-23 Marek Polacek <polacek@redhat.com>
+
+ * c-c++-common/ubsan/bounds-2.c (fn4): Adjust to check the array size
+ in the structure.
+
2014-07-23 Jiong Wang <jiong.wang@arm.com>
* gcc.dg/ira-shrinkwrap-prep-1.c (target): Add arm_nothumb.
/* Test runtime errors. */
struct S { int a[10]; };
+struct T { int a[5]; int s[2]; };
int
foo_5 (void)
static void __attribute__ ((noinline, noclone))
fn4 (void)
{
- volatile int a[5];
- a[foo_5 ()] = 1;
+ struct T t;
+ asm ("" : : "r" (&t.a) : "memory");
+ t.a[foo_5 ()] = 1;
}
static void __attribute__ ((noinline, noclone))