------- Comment #9 from rguenth at gcc dot gnu dot org 2009-06-02 15:04 ------- More reduced testcase, the loop is produced by tail-recursion:
struct Shape { enum Type { ST_RECT, ST_CIRCLE } type; int pos; int CollisionWith(const Shape& s) const; }; int Shape::CollisionWith(const Shape& s) const { if(type == ST_CIRCLE && s.type == ST_RECT) return s.CollisionWith(*this); return (pos + s.pos); } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40321