re PR rtl-optimization/16536 (Incorrect __restrict__ optimization in -O2)
PR rtl-optimization/16536 * gcc.c-torture/execute/restrict-1.c: New test. From-SVN: r84791
This commit is contained in:
parent
1373fd361f
commit
a916927fb5
@ -1,3 +1,8 @@
|
||||
2004-07-16 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
|
||||
|
||||
PR rtl-optimization/16536
|
||||
* gcc.c-torture/execute/restrict-1.c: New test.
|
||||
|
||||
2004-07-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
|
||||
|
||||
PR fortran/15324
|
||||
|
30
gcc/testsuite/gcc.c-torture/execute/restrict-1.c
Normal file
30
gcc/testsuite/gcc.c-torture/execute/restrict-1.c
Normal file
@ -0,0 +1,30 @@
|
||||
/* PR rtl-optimization/16536
|
||||
Origin: Jeremy Denise <jeremy.denise@libertysurf.fr>
|
||||
Reduced: Wolfgang Bangerth <bangerth@dealii.org>
|
||||
Volker Reichelt <reichelt@igpm.rwth-aachen.de> */
|
||||
|
||||
extern void abort ();
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int i, dummy;
|
||||
} A;
|
||||
|
||||
inline A foo (const A* p, const A* q)
|
||||
{
|
||||
return (A){p->i+q->i};
|
||||
}
|
||||
|
||||
void bar (A* __restrict__ p)
|
||||
{
|
||||
*p=foo(p,p);
|
||||
if (p->i!=2)
|
||||
abort();
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
A a={1};
|
||||
bar(&a);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user