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 optimization/12815] [3.3/3.4 Regression] Code compiled with optimization behaves unexpectedly


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();
      }
    }
  }
}


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