Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8168283

adlc: fix error expanding expanded nodes.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • None
    • b146

      Adlc generates wrong expand methods.

      All nodes get an expand method generated, as it's used to finish construction of nodes after the matcher generated them. E.g., temp nodes are added in the expand.

      The error occurs for a 'real' expand generating several sub nodes. The 'real' expand rule calls expand of the newly generated nodes, let's call it sub-expand.

      Unfortunately the matcher sometimes generates superfluous operands that are removed in the expand. The 'real' expand generating sub-nodes does not generate these superfluous operands, therefore running the sub-expand crashes when it tries to remove these.

      This change adds a simple check in the sub-expand to avoid this crash. Also it adds setting the correct number of operands in the expand that generates the sub node.

      An example of an adl instruct declaration and the generated code is attached. We see this in a rule for the s390 port.

            goetz Goetz Lindenmaier
            goetz Goetz Lindenmaier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: