public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55365] New: internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189
@ 2012-11-17 15:39 jasongross9+bugzilla at gmail dot com
  2012-11-17 16:05 ` [Bug c++/55365] " jasongross9+bugzilla at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jasongross9+bugzilla at gmail dot com @ 2012-11-17 15:39 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55365
           Summary: internal compiler error: in
                    process_init_constructor_union, at cp/typeck2.c:1335;
                    internal compiler error: in lookup_field_1, at
                    cp/search.c:387; internal compiler error: in
                    process_init_constructor_record, at cp/typeck2.c:1189
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jasongross9+bugzilla@gmail.com


$ /afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/g++ -std=c++11 -c
free_list.cpp  -v -save-temps
Using built-in specs.
COLLECT_GCC=/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/g++
Target: x86_64-unknown-linux-gnu
Configured with: ./configure
--prefix=/afs/csail/proj/courses/6.172/gcc-cilkplus --enable-languages=c,c++
Thread model: posix
gcc version 4.8.0 20120618 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-std=c++11' '-c' '-v' '-save-temps' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-E -quiet -v -iprefix
/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/
-D_GNU_SOURCE free_list.cpp -mtune=generic -march=x86-64 -std=c++11
-fpch-preprocess -o free_list.ii
ignoring nonexistent directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include"
ignoring duplicate directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed"
ignoring nonexistent directory
"/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/intel/composer_xe_2013.0.079/mkl/include
 /opt/intel/composer_xe_2013.0.079/tbb/include

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed
 /usr/local/include

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../lib/gcc/../../include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-std=c++11' '-c' '-v' '-save-temps' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/afs/csail.mit.edu/proj/courses/6.172/gcc-cilkplus/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-fpreprocessed free_list.ii -quiet -dumpbase free_list.cpp -mtune=generic
-march=x86-64 -auxbase free_list -std=c++11 -version -o free_list.s
GNU C++ (GCC) version 4.8.0 20120618 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.8.0 20120618 (experimental), GMP version
5.0.2, MPFR version 3.1.0, MPC version 0.9
warning: GMP header version 5.0.2 differs from library version 4.3.2.
warning: MPFR header version 3.1.0 differs from library version 3.0.0-p3.
warning: MPC header version 0.9 differs from library version 0.8.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.8.0 20120618 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.8.0 20120618 (experimental), GMP version
5.0.2, MPFR version 3.1.0, MPC version 0.9
warning: GMP header version 5.0.2 differs from library version 4.3.2.
warning: MPFR header version 3.1.0 differs from library version 3.0.0-p3.
warning: MPC header version 0.9 differs from library version 0.8.2.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 9140df29c77763bd28b47359117a6952
free_list.cpp: In instantiation of ‘Foo<T>::Foo(T&&) [with T = Bar]’:
free_list.cpp:23:37:   required from here
free_list.cpp:13:23: error: ‘b’ was not declared in this scope
       : _data{ .b = c } { }
                       ^
free_list.cpp:13:23: internal compiler error: in
process_init_constructor_union, at cp/typeck2.c:1335
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ cat free_list.ii
# 1 "free_list.cpp"
# 1 "<command-line>"
# 1 "free_list.cpp"
template <typename T>
class Foo {
 private:
  union arr_or_b {
    T b;
    char arr[];
  };

  arr_or_b _data;

 public:
  Foo(T &&c)
      : _data{ .b = c } { }
};

struct Bar;

struct Bar {
  Foo<Bar> *foo;
};

void quz() {
  Foo<Bar> *foo = new Foo<Bar>(Bar());
}




If I replace "      : _data{ .b = c } { }" with "      : _data({ .b = c }) {
}", I get "internal compiler error: in lookup_field_1, at cp/search.c:387".  If
I replace it with "      : _data{{ .b = c }} { }" instead, I get "internal
compiler error: in process_init_constructor_record, at cp/typeck2.c:1189".


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

* [Bug c++/55365] internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189
  2012-11-17 15:39 [Bug c++/55365] New: internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189 jasongross9+bugzilla at gmail dot com
@ 2012-11-17 16:05 ` jasongross9+bugzilla at gmail dot com
  2012-11-17 16:10 ` jasongross9+bugzilla at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: jasongross9+bugzilla at gmail dot com @ 2012-11-17 16:05 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Jason <jasongross9+bugzilla at gmail dot com> 2012-11-17 16:04:49 UTC ---
Note that icpc gives me the error message "error: a designator into a
template-dependent type is not allowed" on code similar to this, which seems
like it might be related.

The code snipped (inside the Foo class) that icpc gives me this error message
on is
 static constexpr arr_or_b make_init_data(T &&c) {
    return { .b = c };
  }


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

* [Bug c++/55365] internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189
  2012-11-17 15:39 [Bug c++/55365] New: internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189 jasongross9+bugzilla at gmail dot com
  2012-11-17 16:05 ` [Bug c++/55365] " jasongross9+bugzilla at gmail dot com
@ 2012-11-17 16:10 ` jasongross9+bugzilla at gmail dot com
  2012-11-17 23:18 ` paolo.carlini at oracle dot com
  2013-05-14 14:55 ` [Bug c++/55365] ICE in process_init_constructor_union, at cp/typeck2.c:1335 jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jasongross9+bugzilla at gmail dot com @ 2012-11-17 16:10 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jason <jasongross9+bugzilla at gmail dot com> 2012-11-17 16:10:21 UTC ---
And, indeed, here's a somewhat smaller working example, which g++ says
"internal compiler error: in lookup_field_1, at cp/search.c:387", and icpc says
"error: a designator into a template-dependent type is not allowed"


template<typename T>
union u {
  T a;
  char b;
};

template<typename T>
u<T> make_u(T t) {
  return { .a = t };
}

int main() {
  return make_u<int>(1).a;
}


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

* [Bug c++/55365] internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189
  2012-11-17 15:39 [Bug c++/55365] New: internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189 jasongross9+bugzilla at gmail dot com
  2012-11-17 16:05 ` [Bug c++/55365] " jasongross9+bugzilla at gmail dot com
  2012-11-17 16:10 ` jasongross9+bugzilla at gmail dot com
@ 2012-11-17 23:18 ` paolo.carlini at oracle dot com
  2013-05-14 14:55 ` [Bug c++/55365] ICE in process_init_constructor_union, at cp/typeck2.c:1335 jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-11-17 23:18 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-11-17 23:17:59 UTC ---
*** Bug 55366 has been marked as a duplicate of this bug. ***


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

* [Bug c++/55365] ICE in process_init_constructor_union, at cp/typeck2.c:1335
  2012-11-17 15:39 [Bug c++/55365] New: internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189 jasongross9+bugzilla at gmail dot com
                   ` (2 preceding siblings ...)
  2012-11-17 23:18 ` paolo.carlini at oracle dot com
@ 2013-05-14 14:55 ` jason at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jason at gcc dot gnu.org @ 2013-05-14 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jason at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.8.1.

*** This bug has been marked as a duplicate of bug 57041 ***


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

end of thread, other threads:[~2013-05-14 14:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-17 15:39 [Bug c++/55365] New: internal compiler error: in process_init_constructor_union, at cp/typeck2.c:1335; internal compiler error: in lookup_field_1, at cp/search.c:387; internal compiler error: in process_init_constructor_record, at cp/typeck2.c:1189 jasongross9+bugzilla at gmail dot com
2012-11-17 16:05 ` [Bug c++/55365] " jasongross9+bugzilla at gmail dot com
2012-11-17 16:10 ` jasongross9+bugzilla at gmail dot com
2012-11-17 23:18 ` paolo.carlini at oracle dot com
2013-05-14 14:55 ` [Bug c++/55365] ICE in process_init_constructor_union, at cp/typeck2.c:1335 jason at gcc dot gnu.org

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