Bug 41153 - [4.4 Regression] ICE in building Qt4 src/core
Summary: [4.4 Regression] ICE in building Qt4 src/core
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.1
: P1 normal
Target Milestone: 4.4.2
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2009-08-24 11:34 UTC by t66667@gmail.com
Modified: 2009-09-21 11:05 UTC (History)
4 users (show)

See Also:
Host: x86_64-w64-mingw32
Target: x86_64-*-*
Build: i686-linux
Known to work: 4.3.4 4.5.0
Known to fail: 4.4.1
Last reconfirmed: 2009-08-31 12:06:57


Attachments
Preprocessed test case. (80.87 KB, application/octet-stream)
2009-08-31 11:15 UTC, t66667@gmail.com
Details
saves (630 bytes, application/octet-stream)
2009-08-31 11:16 UTC, t66667@gmail.com
Details

Note You need to log in before you can comment on or make changes to this bug.
Description t66667@gmail.com 2009-08-24 11:34:20 UTC
tools/qdatetime.cpp: In member function 'QString QDateTimeParser::sectionText(const QString&, int, int) const':
tools/qdatetime.cpp:4424: warning: case label value is less than minimum value for type
tools/qdatetime.cpp:4425: warning: case label value is less than minimum value for type
tools/qdatetime.cpp:4426: warning: case label value is less than minimum value for type
tools/qdatetime.cpp: In member function 'QString QDateTimeParser::sectionText(int) const':
tools/qdatetime.cpp:4438: warning: case label value is less than minimum value for type
tools/qdatetime.cpp:4439: warning: case label value is less than minimum value for type
tools/qdatetime.cpp:4440: warning: case label value is less than minimum value for type
In file included from ../../include/QtCore/qstring.h:1,
                 from ../../include/QtCore/../../src/corelib/kernel/qobject.h:48,
                 from ../../include/QtCore/qobject.h:1,
                 from ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:45,
                 from ../../include/QtCore/qcoreapplication.h:1,
                 from global/qt_pch.h:58:
../../include/QtCore/../../src/corelib/tools/qstring.h: In member function 'const QChar QString::at(int) const':
../../include/QtCore/../../src/corelib/tools/qstring.h:684: internal compiler error: in tree_nrv, at tree-nrv.c:143
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [tmp/obj/release_static/qdatetime.o] Error 1
Comment 1 Wolfgang Bangerth 2009-08-25 13:46:51 UTC
Please follow the instructions listed in <http://gcc.gnu.org/bugs.html> as
mentioned by the error message. In particular, we need a preprocessed
testcase.
Comment 2 xxcv07 at gmail dot com 2009-08-29 14:19:12 UTC
AFAIK -O0 compiles OK, -O1 fails and cause internal compiler error.
Comment 3 t66667@gmail.com 2009-08-30 09:43:24 UTC
Only encountered with c++ code.
Comment 4 t66667@gmail.com 2009-08-31 11:08:44 UTC
g++ --save-temps -c -omain.o -O -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -IE:\msys\1.0\qt-all-opensource-src-4.5.2/include -IE:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore -IE:\msys\1.0\qt-all-opensource-src-4.5.2/include -IE:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore -IE:\msys\1.0\qt-all-opensource-src-4.5.2/src/corelib/global -IE:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtScript -IE:\msys\1.0\qt-all-opensource-src-4.5.2/mkspecs/win32-g++ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NO_PCRE -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQMAKE_OPENSOURCE_EDITION main.cpp
In file included from E:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore/qstring.h:2,
                 from E:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore/../../src/corelib/io/qiodevice.h:51,
                 from E:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore/qiodevice.h:2,
                 from E:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore/../../src/corelib/io/qdatastream.h:46,
                 from E:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore/qdatastream.h:2,
                 from E:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore/../../src/corelib/tools/qstringlist.h:47,
                 from E:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore/qstringlist.h:2,
                 from project.h:46,
                 from main.cpp:43:
E:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore/../../src/corelib/tools/qstring.h: In member function 'QCharRef::operator QChar() const':
E:\msys\1.0\qt-all-opensource-src-4.5.2/include/QtCore/../../src/corelib/tools/qstring.h:782: internal compiler error: in tree_nrv, at tree-nrv.c:143
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [main.o] Error 1
Comment 5 t66667@gmail.com 2009-08-31 11:15:11 UTC
Created attachment 18454 [details]
Preprocessed test case.
Comment 6 t66667@gmail.com 2009-08-31 11:16:07 UTC
Created attachment 18455 [details]
saves
Comment 7 Richard Biener 2009-08-31 12:06:57 UTC
Reducing (seems to work with 4.5).
Comment 8 Richard Biener 2009-08-31 12:45:32 UTC
Confirmed.

class QString { };
QString fixString(QString string);
static QString fixPathToLocalOS(const QString &in)                              { 
  return fixString(in);
}
void __attribute__((__optimize__ ("0")))
foo(void) { }
void runQMake(QString pfile)
{ 
  fixPathToLocalOS(pfile);
}


triggered by __attribute__((__optimize__ ("0"))) on the unrelated function foo.

Mike, this is yours.
Comment 9 Jakub Jelinek 2009-08-31 14:32:52 UTC
The problem is that the optimization saving/restoring infrastructure seems to ignore OVERRIDE_OPTIONS.  i386 OPTIMIZATION_OPTIONS sets flag_pcc_struct_return to 2 and expects OVERRIDE_OPTIONS to set it to 0 resp. 1 if it is still 2, but as OVERRIDE_OPTIONS isn't called, it remains set to 2, which is treated as if it was 1.
Comment 10 H.J. Lu 2009-09-01 00:35:32 UTC
Target optimization has many issues. See PR 37565.
Comment 11 Jakub Jelinek 2009-09-01 09:32:31 UTC
Mark, I don't think this should be P1, __optimize__ attribute is new in 4.4 (so considering it regression is already quite weird, though the attribute is ignored in older releases, so technically it is a regression, albeit one wouldn't use it with pre-4.4), but more importantly is known to be broken in many ways.
Comment 12 Mark Mitchell 2009-09-01 13:54:03 UTC
I think the question is whether the use of __optimize__ is in a standard Qt release.  If it is, then I'm quite concerned; it's bad if GCC 4.4.2 can't build Qt/KDE.

(TBH, I'm concerned anyhow; if __optimize__ is unreliable, then perhaps we should be ignoring/warning about it in 4.4.x until we get it solid...)
Comment 13 t66667@gmail.com 2009-09-18 09:11:57 UTC
Hmm I haven't noticed this bug has been fixed a week ago, since [Revision 151627], it was still reproducible at [Revision 151584] which was just a day before.
Thanks!!
Comment 14 t66667@gmail.com 2009-09-21 11:05:21 UTC
I can confirm this is fixed in gcc-4_4-branch.
Thank you.