[Bug tree-optimization/18040] [4.0 Regression] ICE in for_each_index, at tree-ssa-loop-im.c:178

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Oct 17 22:19:00 GMT 2004


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-17 22:19 -------
Here is another example which works:
int PyObject_IsTrue();
struct object_base
{
    void ptr() const;
};
struct object : public object_base
{
  void ptr1() const;
  typedef void (object::*bool_type)() const;
  inline operator bool_type() const { return PyObject_IsTrue() ? &object_base::ptr : &object::ptr1; }
};
void f();
void g (void)
{
    for (unsigned n = 0; n < 100; ++n)
    {
        object kv;
        if (kv)
          f();
    }
}

And another which does not:
int PyObject_IsTrue();
struct object_base
{
    void ptr() const;
  void ptr1() const;
};
struct object : public object_base
{
  typedef void (object::*bool_type)() const;
  inline operator bool_type() const { return PyObject_IsTrue() ? &object_base::ptr : &object::ptr1; }
};
void f();
void g (void)
{
    for (unsigned n = 0; n < 100; ++n)
    {
        object kv;
        if (kv)
          f();
    }
}

-- 


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



More information about the Gcc-bugs mailing list