From: Richard Sandiford Date: Thu, 8 May 2014 08:00:21 +0000 (+0000) Subject: re PR sanitizer/61095 (miscompile: tsan is broken in gcc trunk, works in 4.9) X-Git-Tag: releases/gcc-5.1.0~7713 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c7ad35388d4738e3b981c4dbdbf5cbfe7b441c95;p=thirdparty%2Fgcc.git re PR sanitizer/61095 (miscompile: tsan is broken in gcc trunk, works in 4.9) gcc/testsuite/ PR tree-optimization/61095 * gcc.dg/torture/pr61095.c: New test. From-SVN: r210203 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c93294a03371..ce196b0bd316 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-05-08 Richard Sandiford + + PR tree-optimization/61095 + * gcc.dg/torture/pr61095.c: New test. + 2014-05-04 Thomas Preud'homme PR middle-end/39246 diff --git a/gcc/testsuite/gcc.dg/torture/pr61095.c b/gcc/testsuite/gcc.dg/torture/pr61095.c new file mode 100644 index 000000000000..fa584e0353df --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr61095.c @@ -0,0 +1,23 @@ +/* { dg-do run } */ +/* { dg-require-effective-target lp64 } */ + +extern void __attribute__ ((noreturn)) abort (void); + +int __attribute__ ((noinline, noclone)) +foo (unsigned long addr) { + unsigned long *p = (unsigned long*)((addr & 0xffff83fffffffff8UL) * 4); + unsigned long xxx = (unsigned long)(p + 1); + return xxx >= 0x3c000000000UL; +} + +int +main (void) +{ + if (foo (0)) + abort (); + if (foo (0x7c0000000000UL)) + abort (); + if (!foo (0xfc0000000000UL)) + abort (); + return 0; +}