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
This commit is contained in:
Jakub Jelinek 2016-11-23 20:50:23 +01:00 committed by Jakub Jelinek
parent c39dad64b8
commit 871a2c6c8b
2 changed files with 17 additions and 3 deletions

View file

@ -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.

View file

@ -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);