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

Basic blocks pass wrongly optimizes indirect register reads out

    XMLWordPrintable

Details

    • 5e4a1738b0 (qt/qtdeclarative/dev) 5e4a1738b0 (qt/tqtc-qtdeclarative/dev) cbfd4fdecb (qt/qtdeclarative/6.4) cbfd4fdecb (qt/tqtc-qtdeclarative/6.4)

    Description

      Consider:

      import QML
      
      QtObject {
          function test() : int {
              var i = 0, x;
              while (i == 0) {
                  x = 1;
                  i = 1;
              }
      
              if (i == 1)
                  return x;
      
              return 0
          }
      }
      

      This crashes the compiler because the register access on x in the "if" block is not correctly propagated. The type propagator still handles it via a second pass, but the basic blocks pass does not understand that x is indirectly propagated "backwards" through the "while". Turning off the life time analysis in QQmlJSBasicBlocks::adjustTypes() fixes the problem, but it's yet unclear at what cost.

      Attachments

        Issue Links

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

          Activity

            People

              ulherman Ulf Hermann
              ulherman Ulf Hermann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes