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
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.
AFAIK -O0 compiles OK, -O1 fails and cause internal compiler error.
Only encountered with c++ code.
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
Created attachment 18454 [details] Preprocessed test case.
Created attachment 18455 [details] saves
Reducing (seems to work with 4.5).
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.
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.
Target optimization has many issues. See PR 37565.
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.
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...)
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!!
I can confirm this is fixed in gcc-4_4-branch. Thank you.