Bug 105784
Summary: | Compiling kde/qt from CVS hangs on QValueList | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Koos <koos.vriezen> |
Component: | gcc | Assignee: | Than Ngo <than> |
Status: | CLOSED RAWHIDE | QA Contact: | Ben Levenson <benl> |
Severity: | high | Docs Contact: | |
Priority: | medium | ||
Version: | rawhide | CC: | nobody+pnasrat |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2003-10-02 09:48:36 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Koos
2003-09-27 14:31:30 UTC
I replicated this on Fedora Core beta 2 by just compiling the above sample. gdb seemed to indicate it was hanging at line 110 of qvaluelist.h: T& operator*() { return node->data; } Hmm, it's beta software, which Red Hat doses not support. Please report this bug to trolltech or kde developers. Please tell them which gcc version you use. Thanks Imo it's a gcc optimization bug. (*it).x = (argc > 1 ? argc : 0) It hang if it assigns the if part (argc) and not if it assign the else part (0). How can that be Qt fault? Btw, Paul Nasrat suggest it's reproducable with the severn's include Qt. Ok, made another testcase without qt this time, maybe that helps.. #include <iostream> struct Data { int x; }; template <class T> struct Wrapper { Wrapper(Data & d) : data (d) {} Data & operator * () { return data; } Data & data; }; int main(int argc, char**) { Data data; Wrapper<Data> mywrapper(data); (*mywrapper).x = (argc > 1 ? argc : 0); std::cout << (*mywrapper).x << std::endl; } Compile as 'g++ myvaluelist.cpp -o myvaluelist -O2' and it hangs if run with an argument. I've compiled it also with gcc-3.3.1 on an old RH-7.1 system: $ gcc -v Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs Configured with: ../gcc-3.3.1/configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --enable-shared --enable-threads --disable-nls : (reconfigured) ../gcc-3.3.1/configure --prefix=/usr --infodir=/usr/share/info --mandir=/ usr/share/man --enable-shared --enable-threads --disable-nls --enable-languages=c++,f77 Thread model: posix gcc version 3.3.1 And there isn't a hang. Hmm, I got this hang reproduced so soon, that I forgot to reread the code :). Apprently it has nothing to do with templates but with operator *() returning a reference. #include <iostream> struct Data { int x; }; struct Wrapper { Wrapper() {} Data & operator * () { return data; } Data data; }; int main(int argc, char**) { Wrapper mywrapper; (*mywrapper).x = (argc > 1 ? argc : 0); std::cout << (*mywrapper).x << std::endl; } it's now fixed in gcc-3.3.1-6, which will be available in rawhide soon. Thanks for your report. |