This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/12815] [3.3/3.4 Regression] Code compiled with optimization behaves unexpectedly
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Oct 2003 16:11:19 -0000
- Subject: [Bug optimization/12815] [3.3/3.4 Regression] Code compiled with optimization behaves unexpectedly
- References: <20031028154158.12815.boris@kolpackov.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12815
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Summary|Code compiled with |[3.3/3.4 Regression] Code
|optimization behaves |compiled with optimization
|unexpectedly |behaves unexpectedly
Target Milestone|--- |3.3.3
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-10-28 16:11 -------
Here is the smallest I could get it, also it is a regression from 3.0.4:
//#define __GXX_MERGED_TYPEINFO_NAMES
#include <typeinfo>
extern "C" void exit(int);
bool
operator== (std::type_info const* pa, std::type_info const& b)
{
return *pa == b;
}
struct A
{
virtual
~A () {}
};
struct APtr
{
APtr (A* p)
: p_ (p)
{
}
A&
operator* () const
{
return *p_;
}
private:
A* p_;
};
void f(void){exit(1);}
int
main ()
{
APtr ap (new A);
for(bool cont__ = true; cont__;)
{
for(std::type_info const* const exp__ ((&typeid (*ap)));
cont__;
cont__ = false)
{
if(cont__ &&
exp__ == (typeid (int)))
{
f();
}
}
}
}