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 middle-end/29610] [4.1 Regression] ICE when compiling c++ code with -O2 -funswitch-loops



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-10-27 17:46 -------
Confirmed, reduced testcase:
struct __normal_iterator 
{
  typedef int*const *_Iterator;
  int*const * _M_current;
  __normal_iterator(const _Iterator& __i) : _M_current(__i){}
  const _Iterator& base() const {}
};
struct string { ~string(){} };
struct vector 
{
  int** _M_finish;
  __normal_iterator end() const   { return __normal_iterator (_M_finish); }
  int size() const   { return end().base() - end().base(); }
};
class Painter
{
  int redraw_window(void);
  typedef int (Painter::* SliceWindowFunc)(void);
  int for_each(vector&, SliceWindowFunc);
  void tcl_command(void);
};
inline int Painter::for_each(vector &layout, SliceWindowFunc func)
{
    for (unsigned int window = 0; window < layout.size();++window)
        (this->*func)();
}
int t;
int Painter::redraw_window(void) {t = 1;}
string t2(int);
vector *g(const string&);
void Painter::tcl_command(void)
{
     for_each(*g(t2(2)), &Painter::redraw_window);
}


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to fail|                            |4.1.2
      Known to work|                            |4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2006-10-27 17:46:37
               date|                            |
            Summary|ICE when compiling c++ code |[4.1 Regression] ICE when
                   |                            |compiling c++ code with -O2
                   |                            |-funswitch-loops
   Target Milestone|---                         |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29610


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