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

make a MCE(Minimal Complete Example) for gcc 13.2.0 bug in QTransform

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.8, 6.9
    • GUI: Painting
    • None
    • Linux/Wayland, Linux/X11, Linux/Other display system

    Description

      On Ubuntu 24.04

      gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4) seems to remove some
      code in release builds that is embedded in a macro in qtransfrom.cpp.
      This patch changes the macro into a function such that it is not
      removed by gcc.

      It seems like the switch statement is (wrongly) optimized away if it is
      embedded in the QTransform::map(QPolygonF) overload. nx and ny are
      always 0 (as initialized by QPolygonF) after the macro (but only within
      the QTransform::map(QPolygonF) function.

      The bug happens only in a release build. Added debug messages of nx and
      ny created no output, adding qDebug() << t, which made the macro work.

      It seems that a complex combination of macro and switch statement can
      tigger the bug in gcc. So rewriting the macro as a function works around
      the bug.

      More details in https://bugreports.qt.io/browse/QTBUG-127723 and https://codereview.qt-project.org/c/qt/qtbase/+/581308

      We'd better to have a MCE and submit to gcc upstream.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              vgt Eirik Aavitsland
              liaqi Liang Qi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes