diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-11-28 17:28:06 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-11-28 17:28:06 +0100 |
commit | c7e20b0b087e876a2e0694851e7c0c25cc8dcef4 (patch) | |
tree | 950b0ba4fcaed1b89388e871c28448da640deb78 | |
parent | e87ef71b0544e9633bc3eed9f169a604e078ef67 (diff) | |
download | gcc-c7e20b0b087e876a2e0694851e7c0c25cc8dcef4.zip gcc-c7e20b0b087e876a2e0694851e7c0c25cc8dcef4.tar.gz gcc-c7e20b0b087e876a2e0694851e7c0c25cc8dcef4.tar.bz2 |
re PR testsuite/55504 (gcc.c-torture/execute/20071018-1.c execution failures with -fsanitize=address)
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
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/20071018-1.c | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d01a700..cc7d710 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +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... diff --git a/gcc/testsuite/gcc.c-torture/execute/20071018-1.c b/gcc/testsuite/gcc.c-torture/execute/20071018-1.c index ae13c73..625e981 100644 --- a/gcc/testsuite/gcc.c-torture/execute/20071018-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/20071018-1.c @@ -13,11 +13,11 @@ void __attribute__((noinline)) bar(struct foo **f) { *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; @@ -25,7 +25,7 @@ struct foo * foo(int rank) int main() { - if (foo(0) == 0) + if (foo(1) == 0) abort (); return 0; } |