public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
@ 2010-11-03 14:29 ro at gcc dot gnu.org
  2010-11-03 14:30 ` [Bug c++/46289] " ro at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: ro at gcc dot gnu.org @ 2010-11-03 14:29 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.6 regression] ICE in
                    build_constexpr_constructor_member_initializers, at
                    cp/semantics.c:5513
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ro@gcc.gnu.org
              Host: sparc-sun-solaris2.10
            Target: sparc-sun-solaris2.10
             Build: sparc-sun-solaris2.10


Created attachment 22252
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22252
preprocessed input

As of rev. 166242, building libstdc++ fails on Solaris 10/SPARC:

$ /var/gcc/regression/trunk/10-gcc-gas/build/./gcc/xgcc -shared-libgcc
-B/var/gcc/regression/trunk/10-gcc-gas/build/./gcc -nostdinc++
-L/var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/libstdc++-v3/src
-L/var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/libstdc++-v3/src/.libs
-B/vol/gcc/sparc-sun-solaris2.10/bin/ -B/vol/gcc/sparc-sun-solaris2.10/lib/
-isystem /vol/gcc/sparc-sun-solaris2.10/include -isystem
/vol/gcc/sparc-sun-solaris2.10/sys-include    -x c++-header -nostdinc++ -g -O2
-I/var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/libstdc++-v3/include/sparc-sun-solaris2.10
-I/var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/libstdc++-v3/include
-I/vol/gcc/src/hg/trunk/local/libstdc++-v3/libsupc++ -O2 -g -std=gnu++0x
/vol/gcc/src/hg/trunk/local/libstdc++-v3/include/precompiled/stdc++.h -o
sparc-sun-solaris2.10/bits/stdc++.h.gch/O2ggnu++0x.gch
In file included from
/var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/libstdc++-v3/include/condition_variable:39:0,
                 from
/vol/gcc/src/hg/trunk/local/libstdc++-v3/include/precompiled/stdc++.h:101:
/var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/libstdc++-v3/include/mutex:
In constructor 'constexpr std::mutex::mutex()':
/var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/libstdc++-v3/include/mutex:71:54:
error: could not convert '{{0, 0, 0, 0, 19800}, {{{0}}}, 0}' to
'std::mutex::__native_type'
/var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/libstdc++-v3/include/mutex:71:58:
internal compiler error: in build_constexpr_constructor_member_initializers, at
cp/semantics.c:5513

$ cc1plus -fpreprocessed stdc++.ii -quiet -dumpbase stdc++.h -mcpu=v9 -auxbase
stdc++ -g -g -O2 -O2 -std=gnu++0x -version -o stdc++.s --output-pch=
sparc-sun-solaris2.10/bits/stdc++.h.gch/O2ggnu++0x.gch


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

* [Bug c++/46289] [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
  2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
@ 2010-11-03 14:30 ` ro at gcc dot gnu.org
  2010-11-03 14:34 ` ro at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ro at gcc dot gnu.org @ 2010-11-03 14:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Rainer Orth <ro at gcc dot gnu.org> 2010-11-03 14:29:48 UTC ---
Btw., I saw the same issue on i386-pc-solaris2.10, but this is now hidden by
PR bootstrap/46018.


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

* [Bug c++/46289] [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
  2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
  2010-11-03 14:30 ` [Bug c++/46289] " ro at gcc dot gnu.org
@ 2010-11-03 14:34 ` ro at gcc dot gnu.org
  2010-11-03 14:39 ` redi at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ro at gcc dot gnu.org @ 2010-11-03 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com

--- Comment #2 from Rainer Orth <ro at gcc dot gnu.org> 2010-11-03 14:34:32 UTC ---
This is almost certainly caused by this patch:

2010-11-01  Gabriel Dos Reis  <gdr@cse.tamu.edu>
        Jason Merrill  <jason@redhat.com>

    * call.c (null_ptr_cst_p): Use maybe_constant_value.
    (set_up_extended_ref_temp): Support constant initialization.
    (initialize_reference): Adjust.
[...]
    * semantics.c (constexpr_fundef): New datatype.
    (constexpr_fundef_table): New global table.
    (constexpr_fundef_equal): New.
    (constexpr_fundef_hash): Likewise.
    (retrieve_constexpr_fundef): Likewise.
    (validate_constexpr_fundecl): Store in the table.
    (build_data_member_initialization): New fn.
    (build_constexpr_constructor_member_initializers): New.
    (register_constexpr_fundef): Define.
    (is_this_parameter): New.
    (get_function_named_in_call): Likewise.
    (get_nth_callarg): Likewise.
    (check_automatic_or_tls): New.
    (morally_constexpr_builtin_function_p): New.
    (potential_constant_expression): New.


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

* [Bug c++/46289] [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
  2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
  2010-11-03 14:30 ` [Bug c++/46289] " ro at gcc dot gnu.org
  2010-11-03 14:34 ` ro at gcc dot gnu.org
@ 2010-11-03 14:39 ` redi at gcc dot gnu.org
  2010-11-03 15:38 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2010-11-03 14:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |redi at gcc dot gnu.org

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-11-03 14:39:33 UTC ---
Ah, I wondered about that syntax.  We now initialize the pthread_mutex_t member
like so:

mutex() : _M_mutex(PTHREAD_MUTEX_INIT) { }

which is not portable.  We could add config checks to determine where the INIT
macro is valid, and for some platforms we could use:

mutex() : _M_mutex PTHREAD_MUTEX_INIT { }

But the ideal solution is to get brace-or-equal-initializers implemented for
non-static class members, then we can do:

native_type _M_mutex = PTHREAD_MUTEX_INIT;
mutex() { }


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

* [Bug c++/46289] [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
  2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2010-11-03 14:39 ` redi at gcc dot gnu.org
@ 2010-11-03 15:38 ` rguenth at gcc dot gnu.org
  2010-11-03 16:59 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2010-11-03 15:38 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


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

* [Bug c++/46289] [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
  2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2010-11-03 15:38 ` rguenth at gcc dot gnu.org
@ 2010-11-03 16:59 ` jason at gcc dot gnu.org
  2010-11-03 19:13 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2010-11-03 16:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2010-11-03 16:59:34 UTC ---
(In reply to comment #3)
> mutex() : _M_mutex(PTHREAD_MUTEX_INIT) { }
> 
> which is not portable.

Actually, it should work.  Here's a reduced testcase:

struct A
{
  int i[2];
};

struct B
{
  A a;
  constexpr B(): a({{1,2}}) { }
};


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

* [Bug c++/46289] [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
  2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2010-11-03 16:59 ` jason at gcc dot gnu.org
@ 2010-11-03 19:13 ` jason at gcc dot gnu.org
  2010-11-03 21:20 ` bkoz at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2010-11-03 19:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2010-11-03 19:13:30 UTC ---
Author: jason
Date: Wed Nov  3 19:13:27 2010
New Revision: 166270

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166270
Log:
    PR c++/46289
    * semantics.c (build_constexpr_constructor_member_initializers):
    Avoid ICE on error.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-ice3.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/46289] [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
  2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2010-11-03 19:13 ` jason at gcc dot gnu.org
@ 2010-11-03 21:20 ` bkoz at gcc dot gnu.org
  2010-11-04  2:15 ` jason at gcc dot gnu.org
  2010-11-04  3:25 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: bkoz at gcc dot gnu.org @ 2010-11-03 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

Benjamin Kosnik <bkoz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bkoz at gcc dot gnu.org

--- Comment #6 from Benjamin Kosnik <bkoz at gcc dot gnu.org> 2010-11-03 21:20:10 UTC ---

Ah. 

jonathan re #3, FYI and off-topic, I wanted aggregate initializers for the
std::complex constructors. 

ideally then

      _GLIBCXX_CONSTEXPR complex(float __r = 0.0f, float __i = 0.0f)
      : _M_value(__r + __i * 1.0fi) { }

could be

      _GLIBCXX_CONSTEXPR complex(float __r = 0.0f, float __i = 0.0f)
      : _M_value({__r, __i}) { }

less of an issue now that there is some syntax that works as part of a member
initialization list.

-benjamin


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

* [Bug c++/46289] [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
  2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2010-11-03 21:20 ` bkoz at gcc dot gnu.org
@ 2010-11-04  2:15 ` jason at gcc dot gnu.org
  2010-11-04  3:25 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2010-11-04  2:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2010-11-04 02:15:04 UTC ---
Author: jason
Date: Thu Nov  4 02:15:00 2010
New Revision: 166296

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=166296
Log:
    PR c++/46289
    * call.c (can_convert_array): New fn.
    (build_aggr_conv): Use it.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/initlist45.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/46289] [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513
  2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2010-11-04  2:15 ` jason at gcc dot gnu.org
@ 2010-11-04  3:25 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2010-11-04  3:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2010-11-04 03:25:34 UTC ---
Fixed.


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

end of thread, other threads:[~2010-11-04  3:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-03 14:29 [Bug c++/46289] New: [4.6 regression] ICE in build_constexpr_constructor_member_initializers, at cp/semantics.c:5513 ro at gcc dot gnu.org
2010-11-03 14:30 ` [Bug c++/46289] " ro at gcc dot gnu.org
2010-11-03 14:34 ` ro at gcc dot gnu.org
2010-11-03 14:39 ` redi at gcc dot gnu.org
2010-11-03 15:38 ` rguenth at gcc dot gnu.org
2010-11-03 16:59 ` jason at gcc dot gnu.org
2010-11-03 19:13 ` jason at gcc dot gnu.org
2010-11-03 21:20 ` bkoz at gcc dot gnu.org
2010-11-04  2:15 ` jason at gcc dot gnu.org
2010-11-04  3:25 ` 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).