public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/54126] New: ICE on constexpr move ctor with const ref type instead of error
@ 2012-07-30 14:17 morpheby at gmail dot com
  2012-07-30 14:22 ` [Bug c++/54126] " redi at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: morpheby at gmail dot com @ 2012-07-30 14:17 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 54126
           Summary: ICE on constexpr move ctor with const ref type instead
                    of error
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: morpheby@gmail.com


Compiling attached source fails with ICE:
$ gcc -std=c++11 gcc-bug.cpp --save-temps
gcc-bug.cpp: In instantiation of 'constexpr ClassA<T1>::ClassA(U1&&) [with U1 =
int; T1 = const ClassB&]':
gcc-bug.cpp:34:3:   required from here
gcc-bug.cpp:22:12: internal compiler error: in
build_data_member_initialization,
 at cp/semantics.c:5790

GCC version dump: $ gcc -v
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/i686-w64-mingw32/4.7.2/lto-wrapp
er.exe
Target: i686-w64-mingw32
Configured with: ../..//mingw-src/gcc-4_7-branch/configure
--host=i686-w64-mingw
32 --build=i686-w64-mingw32 --target=i686-w64-mingw32
--prefix=/mingw-gcc-4_7-br
anch-x32 --with-sysroot=/mingw-gcc-4_7-branch-x32 --enable-shared
--enable-stati
c --enable-targets=all --enable-multilib --enable-languages=c,c++,fortran,lto
--
enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-lto
-
-enable-graphite --enable-cloog-backend=isl --enable-checking=release
--enable-f
ully-dynamic-string --enable-version-specific-runtime-libs
--enable-sjlj-excepti
ons --disable-ppl-version-check --disable-cloog-version-check
--disable-libstdcx
x-pch --disable-libstdcxx-debug --disable-bootstrap --disable-rpath
--disable-wi
n32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-ld
--wi
th-tune=generic --with-host-libstdcxx='-static -lstdc++' --with-libiconv
--with-
gmp=/mingw-gcc-4_7-branch-libs-x32 --with-mpfr=/mingw-gcc-4_7-branch-libs-x32
--
with-mpc=/mingw-gcc-4_7-branch-libs-x32
--with-ppl=/mingw-gcc-4_7-branch-libs-x3
2 --with-cloog=/mingw-gcc-4_7-branch-libs-x32 --with-pkgversion='MinGW-builds:
h
ttp://sourceforge.net/projects/mingwbuilds/'
--with-bugurl=http://sourceforge.ne
t/projects/mingwbuilds/ CFLAGS='-O2 -pipe -fomit-frame-pointer
-momit-leaf-frame
-pointer -I/mingw-gcc-4_7-branch-libs-x32/include' CXXFLAGS='-O2 -pipe
-fomit-fr
ame-pointer -momit-leaf-frame-pointer' CPPFLAGS= LDFLAGS='-pipe -s
-L/mingw-gcc-
4_7-branch-libs-x32/lib -L/mingw-gcc-4_7-branch-x32/bin'
Thread model: posix
gcc version 4.7.2 20120727 (prerelease) (MinGW-builds:
http://sourceforge.net/pr
ojects/mingwbuilds/)


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

* [Bug c++/54126] ICE on constexpr move ctor with const ref type instead of error
  2012-07-30 14:17 [Bug c++/54126] New: ICE on constexpr move ctor with const ref type instead of error morpheby at gmail dot com
@ 2012-07-30 14:22 ` redi at gcc dot gnu.org
  2012-07-30 14:33 ` morpheby at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2012-07-30 14:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-30 14:22:18 UTC ---
The attachment is missing


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

* [Bug c++/54126] ICE on constexpr move ctor with const ref type instead of error
  2012-07-30 14:17 [Bug c++/54126] New: ICE on constexpr move ctor with const ref type instead of error morpheby at gmail dot com
  2012-07-30 14:22 ` [Bug c++/54126] " redi at gcc dot gnu.org
@ 2012-07-30 14:33 ` morpheby at gmail dot com
  2012-07-30 14:53 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: morpheby at gmail dot com @ 2012-07-30 14:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Ilya Mikhaltsou <morpheby at gmail dot com> 2012-07-30 14:33:41 UTC ---
Created attachment 27896
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27896
Preprocessed source


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

* [Bug c++/54126] ICE on constexpr move ctor with const ref type instead of error
  2012-07-30 14:17 [Bug c++/54126] New: ICE on constexpr move ctor with const ref type instead of error morpheby at gmail dot com
  2012-07-30 14:22 ` [Bug c++/54126] " redi at gcc dot gnu.org
  2012-07-30 14:33 ` morpheby at gmail dot com
@ 2012-07-30 14:53 ` redi at gcc dot gnu.org
  2012-07-30 14:56 ` morpheby at gmail dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: redi at gcc dot gnu.org @ 2012-07-30 14:53 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-07-30
     Ever Confirmed|0                           |1


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

* [Bug c++/54126] ICE on constexpr move ctor with const ref type instead of error
  2012-07-30 14:17 [Bug c++/54126] New: ICE on constexpr move ctor with const ref type instead of error morpheby at gmail dot com
                   ` (2 preceding siblings ...)
  2012-07-30 14:53 ` redi at gcc dot gnu.org
@ 2012-07-30 14:56 ` morpheby at gmail dot com
  2013-02-13  7:29 ` freddie_chopin at op dot pl
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: morpheby at gmail dot com @ 2012-07-30 14:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Ilya Mikhaltsou <morpheby at gmail dot com> 2012-07-30 14:56:31 UTC ---
Reduced source:

namespace std {
template<class _E> class initializer_list {
};
}
using namespace std;

class ClassB {
public:
   constexpr ClassB(int x) {}
};

template<class T1> struct ClassA {
   template<class U1> constexpr ClassA(U1 &&a)
      : a_(a) {}
   T1 a_;
};

void f(std::initializer_list<ClassA<const ClassB&>> l) {
   f({
      {1}
   });
}


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

* [Bug c++/54126] ICE on constexpr move ctor with const ref type instead of error
  2012-07-30 14:17 [Bug c++/54126] New: ICE on constexpr move ctor with const ref type instead of error morpheby at gmail dot com
                   ` (3 preceding siblings ...)
  2012-07-30 14:56 ` morpheby at gmail dot com
@ 2013-02-13  7:29 ` freddie_chopin at op dot pl
  2013-02-13 12:20 ` morpheby at gmail dot com
  2014-08-29 13:27 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: freddie_chopin at op dot pl @ 2013-02-13  7:29 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Freddie Chopin <freddie_chopin at op dot pl> 2013-02-13 07:29:23 UTC ---
Created attachment 29430
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29430
simple fail case

I think I have an even simplier test case, I guess it's the same problem (at
least the ICE message matches). I also think that bug 51707 is actually the
same problem.


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

* [Bug c++/54126] ICE on constexpr move ctor with const ref type instead of error
  2012-07-30 14:17 [Bug c++/54126] New: ICE on constexpr move ctor with const ref type instead of error morpheby at gmail dot com
                   ` (4 preceding siblings ...)
  2013-02-13  7:29 ` freddie_chopin at op dot pl
@ 2013-02-13 12:20 ` morpheby at gmail dot com
  2014-08-29 13:27 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: morpheby at gmail dot com @ 2013-02-13 12:20 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Ilya Mikhaltsou <morpheby at gmail dot com> 2013-02-13 12:20:21 UTC ---
(In reply to comment #4)
> Created attachment 29430 [details]
> simple fail case
> 
> I think I have an even simplier test case, I guess it's the same problem (at
> least the ICE message matches). I also think that bug 51707 is actually the
> same problem.

Yes, looks like both mine and yours testcase actually do the same - they
attempt to move some constexpr to another, and gcc fails. That looks like not
implemented or buggy check for error.

bug 51707 looks to be error on correct code and possibly fails on getting
constant l-value reference.

If they are exactly the same, then the bug actually lies in contexpr reference
mechanics, and gcc fails on getting constexpr reference of any kind, not on
moving constexpr. I'll try to investigate if it is the case as soon as I have
some free time.


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

* [Bug c++/54126] ICE on constexpr move ctor with const ref type instead of error
  2012-07-30 14:17 [Bug c++/54126] New: ICE on constexpr move ctor with const ref type instead of error morpheby at gmail dot com
                   ` (5 preceding siblings ...)
  2013-02-13 12:20 ` morpheby at gmail dot com
@ 2014-08-29 13:27 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-08-29 13:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54126

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to work|                            |4.8.0, 4.9.1, 5.0
         Resolution|---                         |FIXED

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed long time ago. ICEs with improperly reduced testcases involving
std::initializer_list (per Comment #3) are fixed in mainline (Dup of c++/60848,
c++/61723).


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

end of thread, other threads:[~2014-08-29 13:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-30 14:17 [Bug c++/54126] New: ICE on constexpr move ctor with const ref type instead of error morpheby at gmail dot com
2012-07-30 14:22 ` [Bug c++/54126] " redi at gcc dot gnu.org
2012-07-30 14:33 ` morpheby at gmail dot com
2012-07-30 14:53 ` redi at gcc dot gnu.org
2012-07-30 14:56 ` morpheby at gmail dot com
2013-02-13  7:29 ` freddie_chopin at op dot pl
2013-02-13 12:20 ` morpheby at gmail dot com
2014-08-29 13:27 ` 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).