public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50233] New: Internal compiler error: in build_value_init_noctor, at cp/init.c:336
@ 2011-08-30 4:32 naddiseo at gmail dot com
2011-08-30 7:25 ` [Bug c++/50233] " daniel.kruegler at googlemail dot com
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: naddiseo at gmail dot com @ 2011-08-30 4:32 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50233
Bug #: 50233
Summary: Internal compiler error: in build_value_init_noctor,
at cp/init.c:336
Classification: Unclassified
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: naddiseo@gmail.com
Created attachment 25135
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25135
Testcase
I think shared pointers inside a union break when initialized in a constructor
list. See attached test case.
$ /usr/lib/gcc-snapshot/bin/g++ -std=c++0x -o test.bin test.cpp
test.cpp: In constructor 'Test::Test()':
test.cpp:15:16: internal compiler error: in build_value_init_noctor, at
cp/init.c:336
$ /usr/lib/gcc-snapshot/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/lib/gcc-snapshot/bin/g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc-snapshot/libexec/gcc/x86_64-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
20110308-1' --with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs
--enable-languages=c,ada,c++,fortran,objc,obj-c++,go
--prefix=/usr/lib/gcc-snapshot --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --disable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold
--enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic
--enable-checking=yes --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.0 20110308 (experimental) [trunk revision 170786]
(Ubuntu/Linaro 20110308-1)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/50233] Internal compiler error: in build_value_init_noctor, at cp/init.c:336
2011-08-30 4:32 [Bug c++/50233] New: Internal compiler error: in build_value_init_noctor, at cp/init.c:336 naddiseo at gmail dot com
@ 2011-08-30 7:25 ` daniel.kruegler at googlemail dot com
2011-08-30 9:36 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-08-30 7:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50233
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> 2011-08-30 06:33:44 UTC ---
Seems to be fixed in 4.7.0 (Tested with 4.7.0 20110820 (experimental))
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/50233] Internal compiler error: in build_value_init_noctor, at cp/init.c:336
2011-08-30 4:32 [Bug c++/50233] New: Internal compiler error: in build_value_init_noctor, at cp/init.c:336 naddiseo at gmail dot com
2011-08-30 7:25 ` [Bug c++/50233] " daniel.kruegler at googlemail dot com
@ 2011-08-30 9:36 ` paolo.carlini at oracle dot com
2011-08-30 9:38 ` daniel.kruegler at googlemail dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-30 9:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50233
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-30 09:14:25 UTC ---
Good. 4_6-branch behaves the same. Do we agree that GCC is correct in rejecting
this (without ICE-ing of course)?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/50233] Internal compiler error: in build_value_init_noctor, at cp/init.c:336
2011-08-30 4:32 [Bug c++/50233] New: Internal compiler error: in build_value_init_noctor, at cp/init.c:336 naddiseo at gmail dot com
2011-08-30 7:25 ` [Bug c++/50233] " daniel.kruegler at googlemail dot com
2011-08-30 9:36 ` paolo.carlini at oracle dot com
@ 2011-08-30 9:38 ` daniel.kruegler at googlemail dot com
2011-08-30 9:43 ` paolo.carlini at oracle dot com
2011-08-30 10:41 ` daniel.kruegler at googlemail dot com
4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-08-30 9:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50233
--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-08-30 09:30:48 UTC ---
(In reply to comment #2)
> Good. 4_6-branch behaves the same. Do we agree that GCC is correct in rejecting
> this (without ICE-ing of course)?
I think that gcc is right rejecting it. The case is similar to the following
one:
int main()
{
constexpr int i{};
constexpr const int* p = &i;
}
This program is ill-formed, because i is a variable without static storage
duration, and thus does not allow for forming an address-constant expression.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/50233] Internal compiler error: in build_value_init_noctor, at cp/init.c:336
2011-08-30 4:32 [Bug c++/50233] New: Internal compiler error: in build_value_init_noctor, at cp/init.c:336 naddiseo at gmail dot com
` (2 preceding siblings ...)
2011-08-30 9:38 ` daniel.kruegler at googlemail dot com
@ 2011-08-30 9:43 ` paolo.carlini at oracle dot com
2011-08-30 10:41 ` daniel.kruegler at googlemail dot com
4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-08-30 9:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50233
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Known to work| |4.6.2
Resolution| |FIXED
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-08-30 09:37:29 UTC ---
Excellent.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/50233] Internal compiler error: in build_value_init_noctor, at cp/init.c:336
2011-08-30 4:32 [Bug c++/50233] New: Internal compiler error: in build_value_init_noctor, at cp/init.c:336 naddiseo at gmail dot com
` (3 preceding siblings ...)
2011-08-30 9:43 ` paolo.carlini at oracle dot com
@ 2011-08-30 10:41 ` daniel.kruegler at googlemail dot com
4 siblings, 0 replies; 6+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2011-08-30 10:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50233
--- Comment #5 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-08-30 09:52:19 UTC ---
I just notice that the current exclusion of reinterpret_cast in constant
expressions would make it impossible to define addressof as a constexpr
function. C++11 currently invalidates the special portable language rule of
reinterpret_cast, addressof is based on, see also the recent example given in
bug 49171, comment 2.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-08-30 9:52 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-30 4:32 [Bug c++/50233] New: Internal compiler error: in build_value_init_noctor, at cp/init.c:336 naddiseo at gmail dot com
2011-08-30 7:25 ` [Bug c++/50233] " daniel.kruegler at googlemail dot com
2011-08-30 9:36 ` paolo.carlini at oracle dot com
2011-08-30 9:38 ` daniel.kruegler at googlemail dot com
2011-08-30 9:43 ` paolo.carlini at oracle dot com
2011-08-30 10:41 ` daniel.kruegler at googlemail 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).