public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "markus at trippelsdorf dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/56635] [4.8 regression] internal compiler error: in find_lattice_value, at tree-complex.c:15
Date: Sun, 17 Mar 2013 04:45:00 -0000	[thread overview]
Message-ID: <bug-56635-4-CgzzgfKyat@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-56635-4@http.gcc.gnu.org/bugzilla/>


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

Markus Trippelsdorf <markus at trippelsdorf dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markus at trippelsdorf dot
                   |                            |de

--- Comment #3 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2013-03-17 04:44:38 UTC ---
markus@x4 tmp % cat test.ii
template<typename>struct A;
template<typename _Tp>A<_Tp>operator/(A<_Tp>, A<_Tp>& p2)
{
  A<_Tp> a;
  a /= p2;
  return a;
}

template<typename _Tp>bool operator!=(A<_Tp>& p1, A<_Tp>&)
{
  return p1.real();
}

template<>struct A<double>
{
  double& real()
  {
    return __real__ _M_value;
  }

  template<typename _Tp>void operator/=(A<_Tp>&)
  {
    _M_value /= 10;
  }

  _Complex double _M_value;
};

template<class T>class B {
  T *buf;

public:

  B(int, bool);
  T& operator[](int)
  {
    return buf[0];
  }
};

struct C
{
  C(const int&);
  typedef A<double>Ty;
  typedef B<Ty>    DataT;
  A<double>zero;
  enum InitType
  { NOZERO };
  virtual C* DivInv(C *);
};
template<class Sp>class D : Sp {
  typedef typename Sp::Ty    Ty;
  typedef typename Sp::DataT DataT;
  DataT dd;

public:

  D(const int&, C::InitType);
  Ty& operator[](int)
  {
    return dd[0];
  }

  D* DivInv(C *);
};

template<class Sp>D<Sp> *D<Sp>::DivInv(C *)
{
  if ((*this)[0] != this->zero) (*this)[0] = (*static_cast<D *>(0))[0] /
                                             (*this)[0];
  else (*this)[0] = (*static_cast<D *>(0))[0];
  return 0;
}

D<C> *b = new D<C>(0, C::NOZERO);
template<class Sp>D<Sp>::D(const int&, C::InitType) : Sp(0), dd(0, 0)
{}

markus@x4 tmp % c++ -Wextra -Wall -c -O3 test.ii
test.ii: In member function ‘D<Sp>* D<Sp>::DivInv(C*) [with Sp = C]’:
test.ii:67:26: internal compiler error: in find_lattice_value, at
tree-complex.c:151
 template<class Sp>D<Sp> *D<Sp>::DivInv(C *)
                          ^


  parent reply	other threads:[~2013-03-17  4:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-16 15:11 [Bug c/56635] New: " orion at cora dot nwra.com
2013-03-16 16:20 ` [Bug c/56635] " jakub at gcc dot gnu.org
2013-03-17  1:44 ` orion at cora dot nwra.com
2013-03-17  4:45 ` markus at trippelsdorf dot de [this message]
2013-03-17  5:53 ` [Bug tree-optimization/56635] " pinskia at gcc dot gnu.org
2013-03-18  8:27 ` [Bug tree-optimization/56635] [4.8/4.9 " jakub at gcc dot gnu.org
2013-03-18  8:47 ` jakub at gcc dot gnu.org
2013-03-18  9:03 ` jakub at gcc dot gnu.org
2013-03-18 13:02 ` jakub at gcc dot gnu.org
2013-03-20  8:43 ` jakub at gcc dot gnu.org
2013-03-20  8:43 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-56635-4-CgzzgfKyat@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).