From: Jakub Jelinek Date: Wed, 23 Nov 2016 19:50:23 +0000 (+0100) Subject: re PR tree-optimization/78482 (wrong code at -O3 in both 32-bit and 64-bit modes... X-Git-Tag: upstream/12.2.0~43030 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=871a2c6c8bb82158a9ab4a54a3e8114a098641ea;p=platform%2Fupstream%2Fgcc.git 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 --- 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 + 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);