This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/16536] [3.3 regression] Incorrect __restrict__ optimization in -O2
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jul 2004 13:02:48 -0000
- Subject: [Bug rtl-optimization/16536] [3.3 regression] Incorrect __restrict__ optimization in -O2
- References: <20040714132218.16536.jeremy.denise@libertysurf.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-07-15 13:02 -------
I'll do some regression hunting to identify the patch.
Just one more: The C and C++ frontend show different behavior.
The following testcase is valid C and C++. It should return 2.
====================================
typedef struct
{
int i, j;
} A;
inline A foo (const A* p, const A* q)
{
return (A){p->i+q->i};
}
int bar(A* __restrict__ p)
{
(*p)=foo(p,p);
return p->i;
}
int main()
{
A a={1};
return bar(&a);
}
====================================
Compiled a C program we fail since gcc 3.0, with C++ since gcc 3.3.
Both cases seem to be fixed with 3.4.1.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16536