- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm facing the following bug in icpc 11.1. See comparison with g++ below.
addDays is defined as:
QDate addDays ( int ndays ) const
Below's what happens. Is this a known problem? Anyone any idea how to tackle that?
Thanks // Tom
root@avs1# cat t.cpp
#include
QDateTime timeOverPoint(const QDateTime& refTime)
{
QDate date = refTime.date();
qDebug("### date=%s dateAddDays=%s", date.toString().latin1(),
date.addDays(1).toString().latin1());
// this works:
QDate date1 = date.addDays(1);
qDebug("### date=%s", date1.toString().latin1());
// this fails and toString() returns a null string
date = date.addDays(1);
qDebug("### date=%s", date.toString().latin1());
return QDateTime(date, refTime.time());
}
main()
{
timeOverPoint(QDateTime(QDate(2009, 11, 1), QTime(10, 10, 10)));
}
root@avs1# g++ -g -o t t.cpp -I/usr/local/qt338/include -L/usr/local/qt338/lib -lqt-mt
root@avs1# ./t
### date=Sun Nov 1 2009 dateAddDays=Mon Nov 2 2009
### date=Mon Nov 2 2009
### date=Mon Nov 2 2009
root@avs1# icpc -g -o t t.cpp -I/usr/local/qt338/include -L/usr/local/qt338/lib -lqt-mt
root@avs1# ./t
### date=Sun Nov 1 2009 dateAddDays=Mon Nov 2 2009
### date=Mon Nov 2 2009
### date=(null)
root@avs1# icpc -V
Intel C++ Compiler Professional for applications running on IA-32, Version 11.1 Build 20091012 Package ID: l_cproc_p_11.1.059
Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks!
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot for looking into it. Attached is the zipped output of:
icpc -g t.cpp -I/usr/local/qt338/include -E > t.i
Cheers // Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks a lot for looking into it. Attached is the zipped output of:
icpc -g t.cpp -I/usr/local/qt338/include -E > t.i
Cheers // Tom
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dale,
Any news about this? Any progress?
Thanks and cheers // Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tom, sorry for the long delay. I'm still working on this, but I'll try to give you an update later this week.
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK Tom, I filed an issue on this (CQ149875, for future reference) but I'm still not 100% sure that the problem is with icc, it could be a g++ problem. When I look at it in the debugger, the gcc built library does something a little funky that looks like it's overwriting the contents of one of the parameters (i.e. *this) with a 0. I'm not sure we're doing something wrong or if gcc is. I wrote a small test case to just build addDays() and I can see the problem if I build it with gcc -O2 and build main with icc. If I build both with icc, or even if I build addDays with gcc -O0 then I don't see the problem. In short, one workaround maybe to build libqt-mt with icc, if that's feasible. In the meantime I've escalated this to our developers to get their feedback on it and will update you here when I learn more.
Thanks!
Dale
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for looking into this. Do you have any news about it form the developers?
Thanks a lot // Tom
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page