diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-11-23 20:50:23 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-11-23 20:50:23 +0100 |
commit | 871a2c6c8bb82158a9ab4a54a3e8114a098641ea (patch) | |
tree | 344678b6b00fc7c8149c80c8f5a7ff30427f3971 /gcc | |
parent | c39dad64b8b3df3da912134d339ef5fe5c45fad0 (diff) | |
download | gcc-871a2c6c8bb82158a9ab4a54a3e8114a098641ea.zip gcc-871a2c6c8bb82158a9ab4a54a3e8114a098641ea.tar.gz gcc-871a2c6c8bb82158a9ab4a54a3e8114a098641ea.tar.bz2 |
re PR tree-optimization/78482 (wrong code at -O3 in both 32-bit and 64-bit modes on x86_64-linux-gnu)
PR tree-optimization/78482
* gcc.dg/torture/pr78482.c (c, d): Use signed char instead of char.
(bar): New function.
(main): Call bar instead of printf.
From-SVN: r242794
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr78482.c | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6c95928..317b4d1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2016-11-23 Jakub Jelinek <jakub@redhat.com> + PR tree-optimization/78482 + * gcc.dg/torture/pr78482.c (c, d): Use signed char instead of char. + (bar): New function. + (main): Call bar instead of printf. + PR middle-end/69183 * gfortran.dg/gomp/pr69183.f90: New test. diff --git a/gcc/testsuite/gcc.dg/torture/pr78482.c b/gcc/testsuite/gcc.dg/torture/pr78482.c index ef68bdf..cbf4d19 100644 --- a/gcc/testsuite/gcc.dg/torture/pr78482.c +++ b/gcc/testsuite/gcc.dg/torture/pr78482.c @@ -1,9 +1,9 @@ +/* PR tree-optimization/78482 */ /* { dg-do run } */ -int printf(const char*, ...); short a = 65531; int b = 3, f; -char c, d; +signed char c, d; static void fn1(int p1) { short e; @@ -22,13 +22,22 @@ static void fn1(int p1) } } +__attribute__((noinline, noclone)) +int bar (const char *x, int y) +{ + asm volatile ("" : "+g" (x), "+g" (y) : : "memory"); + if (y == 2) + __builtin_abort (); + return 0; +} + int main() { for (; c >= 0; c--) { if (!b) { - printf("%d\n", 2); + bar("%d\n", 2); continue; } fn1(a); |