Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.5, 6.8, 6.9, 6.10
-
None
-
2afe05b64 (tqtc/lts-6.5), a85d36b8a (6.10), bb98127e3 (6.10), 2993762d3 (6.9), cf15698d4 (6.9), ca8b14feb (6.9), c36360eb1 (6.9), 9bfcc36f2 (tqtc/lts-6.8), 9bc25cd53 (tqtc/lts-6.8), dfc56c205 (tqtc/lts-6.8), 564d2eb26 (tqtc/lts-6.8), b9974d82c (dev)
Description
The example from https://www.qt.io/blog/compiling-qml-to-c-a-4x-speedup doesn't compile to C++ anymore. You instead get:
Categorizer.qml:24: warning: Could not compile binding for numbers: Cannot generate efficient code for storing an array in a non-sequence type [compiler] Categorizer.qml:39: warning: Could not compile function sum: Cannot generate efficient code for LoadElement on a sequence potentially affected by side effects [compiler] Categorizer.qml:59: warning: Could not compile binding for onCompleted: Cannot generate efficient code for LoadElement on a sequence potentially affected by side effects [compiler]
There's no obvious reason for this. The array shouldn't have to be stored in anything but list<double> and the numbers in sum() are not actually affected by any side effects.
In onCompleted it probably assumes console.log() has side effects. We could deal with that by starting to mark specific functions as pure. However, onCompleted is not the hot code path here.
Attachments
Issue Links
- is duplicated by
-
QTBUG-137558 Qt Quick Compiler fails to compile array
-
- Closed
-
For Gerrit Dashboard: QTBUG-137540 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
656262,3 | WIP: QmlCompiler: Discern between different kinds of side effects | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: NEW | -2 | 0 |
653739,7 | QmlCompiler: Restore support for writing to temporary arrays | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
654062,1 | QtQml: Do not use redundant stack slots for array member expressions | dev | qt/qtdeclarative | Status: ABANDONED | 0 | 0 |
654063,3 | QJSEngine: Optimize conversions between double and int | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
654534,5 | QmlCompiler: Simplify register allocation | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
654663,2 | QJSEngine: Optimize conversions between double and int | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
654707,5 | QmlCompiler: Sharpen side effect detection | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
654710,5 | QmlCompiler: Discern between different kinds of side effects | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
654908,2 | QJSEngine: Optimize conversions between double and int | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
655174,2 | QJSEngine: Optimize conversions between double and int | tqtc/lts-6.8 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
655180,2 | QmlCompiler: Simplify register allocation | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
655181,2 | QmlCompiler: Restore support for writing to temporary arrays | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
655258,2 | QJSEngine: Optimize conversions between double and int | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
655275,2 | QmlCompiler: Sharpen side effect detection | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
655276,2 | QmlCompiler: Discern between different kinds of side effects | 6.10 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
655285,3 | QmlCompiler: Simplify register allocation | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
655286,3 | QmlCompiler: Restore support for writing to temporary arrays | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
655642,3 | QmlCompiler: Sharpen side effect detection | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
655645,3 | QmlCompiler: Discern between different kinds of side effects | 6.9 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
655650,3 | QmlCompiler: Simplify register allocation | tqtc/lts-6.8 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
655651,3 | QmlCompiler: Restore support for writing to temporary arrays | tqtc/lts-6.8 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
655920,3 | QmlCompiler: Sharpen side effect detection | tqtc/lts-6.8 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
655921,3 | QmlCompiler: Discern between different kinds of side effects | tqtc/lts-6.8 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
656259,3 | WIP: QmlCompiler: Simplify register allocation | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: ABANDONED | -2 | 0 |
656260,1 | QmlCompiler: Restore support for writing to temporary arrays | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: ABANDONED | 0 | 0 |
656261,1 | QmlCompiler: Sharpen side effect detection | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: ABANDONED | 0 | 0 |
656445,1 | WIP: Preserve external side effects across jumps | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: ABANDONED | -2 | 0 |
656450,5 | QmlCompiler: Preserve external side effects across jumps | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
657052,1 | QmlCompiler: Preserve external side effects across jumps | 6.10 | qt/qtdeclarative | Status: STAGED | +2 | 0 |