public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53349] New: Internal compiler error with constexpr and recursive data type.
@ 2012-05-14 22:21 pkeir at dcs dot gla.ac.uk
  2012-05-15 11:19 ` [Bug c++/53349] " daniel.kruegler at googlemail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: pkeir at dcs dot gla.ac.uk @ 2012-05-14 22:21 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53349
           Summary: Internal compiler error with constexpr and recursive
                    data type.
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pkeir@dcs.gla.ac.uk


Created attachment 27404
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27404
The file which causes the internal error.

Compiling the attached file will cause an internal compiler error in gcc 4.7.0
under 32-bit Ubuntu 12.04:

g++-4.7 -std=c++11 rec_constexpr.cpp

...
constfft.cpp:16:47: internal compiler error: in cxx_eval_indirect_ref, at
cp/semantics.c:7400

If the copy constructor of Foo is removed, it is clang 3.2 (trunk 156580) which
will then fail.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/53349] Internal compiler error with constexpr and recursive data type.
  2012-05-14 22:21 [Bug c++/53349] New: Internal compiler error with constexpr and recursive data type pkeir at dcs dot gla.ac.uk
@ 2012-05-15 11:19 ` daniel.kruegler at googlemail dot com
  2012-05-20 20:00 ` pinskia at gcc dot gnu.org
  2013-08-11 22:08 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-05-15 11:19 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler at
                   |                            |googlemail dot com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-05-15 10:53:22 UTC ---
I can confirm this for gcc 4.8.0 20120513 (experimental).

A current workaround is to replace the member declaration

constexpr Foo(const Foo<N-1> a) : m_a(a)     {}

by

constexpr Foo(const Foo<N-1>& a) : m_a(a)     {}

The following is a simplified form of the problem:

template<int N>
struct Foo {
  constexpr Foo(const Foo<N-1> a) : m_a(a)     {} // Line 3
  constexpr Foo(const Foo<N> &a)  : m_a(a.m_a) {}
  Foo<N-1> m_a;
};

template <> struct Foo<0> {};

constexpr auto res = Foo<2>(Foo<1>(Foo<0>())); // Line 10

10|  in constexpr expansion of 'Foo<2>(Foo<1>((*(const Foo<1>*)(&
Foo<1>((Foo<0>((* & Foo<0>())), Foo<0>()))))))'|
3|  in constexpr expansion of '((Foo<2>*)this)->Foo<2>::m_a.Foo<N>::Foo<1>((* &
a))'|
10|internal compiler error: in cxx_eval_indirect_ref, at cp/semantics.c:7408|


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/53349] Internal compiler error with constexpr and recursive data type.
  2012-05-14 22:21 [Bug c++/53349] New: Internal compiler error with constexpr and recursive data type pkeir at dcs dot gla.ac.uk
  2012-05-15 11:19 ` [Bug c++/53349] " daniel.kruegler at googlemail dot com
@ 2012-05-20 20:00 ` pinskia at gcc dot gnu.org
  2013-08-11 22:08 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-05-20 20:00 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-05-20
     Ever Confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-05-20 19:08:01 UTC ---
Confirmed.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/53349] Internal compiler error with constexpr and recursive data type
  2012-05-14 22:21 [Bug c++/53349] New: Internal compiler error with constexpr and recursive data type pkeir at dcs dot gla.ac.uk
  2012-05-15 11:19 ` [Bug c++/53349] " daniel.kruegler at googlemail dot com
  2012-05-20 20:00 ` pinskia at gcc dot gnu.org
@ 2013-08-11 22:08 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-08-11 22:08 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Done.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-11 22:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-14 22:21 [Bug c++/53349] New: Internal compiler error with constexpr and recursive data type pkeir at dcs dot gla.ac.uk
2012-05-15 11:19 ` [Bug c++/53349] " daniel.kruegler at googlemail dot com
2012-05-20 20:00 ` pinskia at gcc dot gnu.org
2013-08-11 22:08 ` paolo.carlini at oracle dot com

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).