From: Volker Reichelt Date: Fri, 16 Jul 2004 00:25:59 +0000 (+0000) Subject: re PR rtl-optimization/16536 (Incorrect __restrict__ optimization in -O2) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a916927fb5f966bf29dd99e44e195c7d0b3c028b;p=gcc.git 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 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8626dbb85ea..1f5163845f1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-07-16 Volker Reichelt + + PR rtl-optimization/16536 + * gcc.c-torture/execute/restrict-1.c: New test. + 2004-07-15 Tobias Schlueter PR fortran/15324 diff --git a/gcc/testsuite/gcc.c-torture/execute/restrict-1.c b/gcc/testsuite/gcc.c-torture/execute/restrict-1.c new file mode 100644 index 00000000000..3c5696cb597 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/restrict-1.c @@ -0,0 +1,30 @@ +/* PR rtl-optimization/16536 + Origin: Jeremy Denise + Reduced: Wolfgang Bangerth + Volker Reichelt */ + +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; +}