Re: [Bug c++/45246] New: optimizer dereference

2010-08-10 Thread Andrew Pinski
On Aug 10, 2010, at 1:00 AM, "attardi at di dot unipi dot it" > wrote: Code produced using -O2 handles dereferencing incorrectly. Here is a program that shows the bug: #include #include class Derived : public std::vector { public: Derived() {} }; void* foo(void* arg) { void* basept

[Bug c++/45246] New: optimizer dereference

2010-08-10 Thread attardi at di dot unipi dot it
Code produced using -O2 handles dereferencing incorrectly. Here is a program that shows the bug: #include #include class Derived : public std::vector { public: Derived() {} }; void* foo(void* arg) { void* baseptr = 0; *(std::vector **)&baseptr = (Derived *)arg; return baseptr