Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-61123

REG 5.7->5.8: aliasing issue with gcc causes test failures

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.1
    • 5.8.0, 5.9.0
    • WIndows 10 64bit, MinGW 5.3 32bit g++ (i686-win32-dwarf-rev0, Built by MinGW-W64 project) 5.3.0, release builds only and Kubuntu 16.04/64bit gcc 5.4
    • 55d2d4cfc0b5c64b0fd8a80b868673971200f7c4

    Description

      The construct

          union {
              qle_bitfield<...> type;
              qle_bitfield<...> flags;
          }
      

      in two places in QV4::CompiledData::Property and ::Binding causes test failures below:

      ********* Start testing of tst_qqmlecmascript *********
      Config: Using QtTest library 5.9.1, Qt 5.9.1 (i386-little_endian-ilp32 shared (dynamic) release build; by GCC 5.3.0)
      PASS   : tst_qqmlecmascript::initTestCase()
      FAIL!  : tst_qqmlecmascript::readonlyDeclaration() Compared values are not the same
         Actual   (object->property("test").toBool()): 0
         Expected (true)                             : 1
      tst_qqmlecmascript.cpp(5407) : failure location
      PASS   : tst_qqmlecmascript::cleanupTestCase()
      Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 25ms
      ********* Finished testing of tst_qqmlecmascript *********
      

      Similar:

      ********* Start testing of tst_qqmlecmascript *********
      Config: Using QtTest library 5.9.1, Qt 5.9.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.4.0 20160609)
      PASS   : tst_qqmlecmascript::initTestCase()
      FAIL!  : tst_qqmlecmascript::readonlyDeclaration() Compared values are not the same
         Actual   (object->property("test").toBool()): 0
         Expected (true)                             : 1
         Loc: [tst_qqmlecmascript.cpp(5407)]
      PASS   : tst_qqmlecmascript::cleanupTestCase()
      Totals: 2 passed, 1 failed, 0 skipped, 0 blacklisted, 280ms
      ********* Finished testing of tst_qqmlecmascript *********
      

      QTRY_COMPARE() does not help. The value is QVariant(bool, false)

      Component.onCompleted bails out at
      qtdeclarative\tests\auto\qml\qqmlecmascript\data\readonlyDeclaration.qml:25:

       caught = false;
      try { test1 = 13 } catch (e) { caught = true; }
      if (!caught) return;
      

      since the readonly property "test1" is happily set to 13 and so the final test = true is not reached.

      (See https://codereview.qt-project.org/#/c/195399/ )

      PASS   : tst_qqmlvaluetypes::groupedInterceptors(value-interceptor)
      QWARN  : tst_qqmlvaluetypes::groupedInterceptors(component-interceptor) QQmlComponent: Component is not ready
      FAIL!  : tst_qqmlvaluetypes::groupedInterceptors(component-interceptor) 'object != 0' returned FALSE. (file:////qtdeclarative/tests/auto/qml/qqmlvaluetypes/data/grouped_interceptors_component.qml:5 Property has already been assigned a value
      )
         Loc: [tst_qqmlvaluetypes.cpp(1489)]
      QWARN  : tst_qqmlvaluetypes::groupedInterceptors(ignore-interceptor) QQmlComponent: Component is not ready
      FAIL!  : tst_qqmlvaluetypes::groupedInterceptors(ignore-interceptor) 'object != 0' returned FALSE. (file:////qtdeclarative/tests/auto/qml/qqmlvaluetypes/data/grouped_interceptors_ignore.qml:5 Property has already been assigned a value
      

      These two failures (and possibly more) are caused by aliasing issues when gcc generates code for writing/reading these two adjacent fields in -O2 builds.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-61123
          # Subject Branch Project Status CR V

          Activity

            People

              shausman Simon Hausmann
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes