This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/16536] [3.3 regression] Incorrect __restrict__ optimization in -O2


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]