PR testsuite/55504
* gcc.c-torture/execute/
20071018-1.c (foo): Add noinline/noclone
attributes. Avoid clobbering memory before malloced chunk.
(main): Pass 1 instead of 0 as argument.
From-SVN: r193898
+2012-11-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR testsuite/55504
+ * gcc.c-torture/execute/20071018-1.c (foo): Add noinline/noclone
+ attributes. Avoid clobbering memory before malloced chunk.
+ (main): Pass 1 instead of 0 as argument.
+
2012-11-28 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/object_overflow.adb: Rename to...
{
*f = __builtin_malloc(sizeof(struct foo));
}
-struct foo * foo(int rank)
+struct foo * __attribute__((noinline, noclone)) foo(int rank)
{
void *x = __builtin_malloc(sizeof(struct mem));
struct mem *as = x;
- struct foo **upper = &as->x[rank * 8 - 1];
+ struct foo **upper = &as->x[rank * 8 - 5];
*upper = 0;
bar(upper);
return *upper;
int main()
{
- if (foo(0) == 0)
+ if (foo(1) == 0)
abort ();
return 0;
}