[Development] MSVC not inlining QRect inline functions (anymore?)
Thiago Macieira
thiago.macieira at intel.com
Tue Jun 9 01:48:42 CEST 2026
On Monday, 8 June 2026 14:06:34 Pacific Daylight Time Philippe wrote:
> > Can you try /Ob3 ?
>
> Yes it works!
> But only with both /Ob3 and Mårten's patch
> (https://codereview.qt-project.org/c/qt/qtbase/+/742796)
I'm not sure how safe that is. I raise you QPolygon.
See Qt 5's qvector.h:
https://github.com/qt/qtbase/blob/v5.15.0/src/corelib/tools/qvector.h#L1119-L1132
This problem is a reason to follow Marc's advice and not to export the whole
class. But the fix was in QPolygon, not QVector. So even if we don't export the
class, someone deriving from it and exporting their own class may cause our
class to get exported in their DLL's ABI.
I'm personally going to spend mental cycles trying to figure this out. It's not
worth my time to work around even more shortcomings of MSVC, especially when
it comes to performance (we've had to forbid LTO/LTCG mode for it, because it
appears to be broken). The ball is on Microsoft's court. And while they're at
it, they could fix data dllimports and add IFUNC support.
Other people are welcome to spend time figuring this out. But a patch to QtCore
needs to convince me beyond doubt, because I'm the one who ends up having to
maintain these hacks when they break.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Principal Engineer - Intel DCG - Platform & Sys. Eng.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5176 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20260608/ff5ca73e/attachment.bin>
More information about the Development
mailing list