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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-03-25
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |trippels at gcc dot gnu.org
          Component|target                      |ipa
     Ever confirmed|0                           |1

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Also happens on x86_64.

markus@x4 tmp % cat test.ii
template <typename _InputIterator> void __distance (_InputIterator);
template <typename _InputIterator>
void distance (_InputIterator, _InputIterator p2)
{
  __distance (p2);
}

namespace boost
{
template <class Iterator> struct A
{
  typedef typename Iterator::difference_type type;
};
template <class T> typename T::const_iterator end (T &);
template <class T> typename T::const_iterator begin (T &);
template <class T> struct D : A<typename T::const_iterator>
{
};
template <class T> typename D<T>::type distance (const T &p1)
{
  distance (boost::begin (p1), boost::end (p1));
  return 0;
}
template <class IteratorT> class B
{
public:
  typedef B type;
  typedef IteratorT const_iterator;
};
}

typedef int storage_t[];
struct F;
template <template <typename> class> struct G
{
  G (const G &p1) { p1.m_fn1 ().m_fn1 (0); }
  const F &m_fn1 () const
  {
    const void *a;
    a = &data_m;
    return *static_cast<const F *>(a);
  }
  storage_t *data_m;
};

struct F
{
  virtual F *m_fn1 (void *) const;
};
template <typename> struct H;
struct C : G<H>
{
  typedef int difference_type;
};
boost::B<C> AllTransVideos ();
int b = boost::distance (AllTransVideos ());


markus@x4 tmp % g++ -c -O2 test.ii
test.ii: In function ‘void distance(_InputIterator, _InputIterator) [with
_InputIterator = C]’:
test.ii:5:17: internal compiler error: in get_polymorphic_call_info, at
ipa-devirt.c:1292
   __distance (p2);
                 ^
Please submit a full bug report,

Reply via email to