public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55497] New: Local array (char[]) initialized with a size taken from a static variable creates an ICE
@ 2012-11-27 21:32 greg.burri at gmail dot com
  2012-11-27 21:40 ` [Bug c++/55497] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: greg.burri at gmail dot com @ 2012-11-27 21:32 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55497
           Summary: Local array (char[]) initialized with a size taken
                    from a static variable creates an ICE
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: greg.burri@gmail.com


The following lines (41+42) crashes GCC 4.7.2 with an "internal compiler error:
Segmentation fault" message:

https://github.com/Ummon/D-LAN/blob/1.1.0beta13/application/Core/FileManager/priv/Cache/DataWriter.cpp#L42


If the lines are rewritten as this, it compiles without crashing (obviously):

    static const quint32 BUFFER_SIZE = 42;
    char buffer[BUFFER_SIZE];

It compiles well with GCC 4.6.2

Command line and GCC 4.7.2 message:

make[1]: Entering directory `/home/gburri/D-LAN/application/Core/FileManager'
g++ -c -pipe -std=c++0x -g -fPIC -Wall -Wno-parentheses -D_REENTRANT
-DQT_WEBKIT -DDEBUG -DFILEMANAGER_LIBRARY -DQT_NETWORK_LIB -DQT_CORE_LIB
-DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore
-I/usr/include/qt4/QtNetwork -I/usr/include/qt4 -I. -I../.. -I.tmp/debug -o
.tmp/debug/DataWriter.o priv/Cache/DataWriter.cpp
priv/Cache/DataWriter.cpp: In constructor
'FM::DataWriter::DataWriter(FM::Chunk&)':
priv/Cache/DataWriter.cpp:62:1: internal compiler error: Segmentation fault


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

end of thread, other threads:[~2012-11-28 10:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-27 21:32 [Bug c++/55497] New: Local array (char[]) initialized with a size taken from a static variable creates an ICE greg.burri at gmail dot com
2012-11-27 21:40 ` [Bug c++/55497] " paolo.carlini at oracle dot com
2012-11-27 22:28 ` greg.burri at gmail dot com
2012-11-27 22:28 ` greg.burri at gmail dot com
2012-11-27 22:31 ` greg.burri at gmail dot com
2012-11-27 23:42 ` paolo.carlini at oracle dot com
2012-11-28 10:50 ` paolo at gcc dot gnu.org
2012-11-28 10:51 ` 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).