re PR middle-end/17526 (libcpp is miscompiled with -fno-pcc-struct-return -O2)

2008-05-25  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/17526
	* gcc.dg/torture/pr17526.c: New testcase.

From-SVN: r135876
This commit is contained in:
Richard Guenther 2008-05-25 17:16:38 +00:00 committed by Richard Biener
parent 2acceeac67
commit fb238648c4
2 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2008-05-25 Richard Guenther <rguenther@suse.de>
PR tree-optimization/17526
* gcc.dg/torture/pr17526.c: New testcase.
2008-05-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/tg-tests.h: Fix spelling of FP_INFINITE.

View File

@ -0,0 +1,27 @@
/* { dg-do run } */
/* { dg-options "-fno-pcc-struct-return" { target i?86-*-* } } */
void abort(void);
typedef struct { int i; } A;
A __attribute__((noinline))
foo(void)
{
A a = { -1 };
return a;
}
void __attribute__((noinline))
bar(A *p)
{
*p = foo();
}
int main(void)
{
A a;
bar(&a);
if (a.i != -1) abort();
return 0;
}