openjdk/jdk · critical

Invalid match rule %s <-- ( %s )

Error message

Invalid match rule %s <-- ( %s )

What it means

ArchDesc error: the matched node's index in the ideal table is not less than _last_opcode, i.e. the rule references an operator outside the valid ideal-node index range (index was initialized to _last_opcode and the lookup failed or returned something out of range). The rule is rejected with 'Invalid match rule <result> <-- ( <rootOp> )' and an assert fires in debug adlc.

Source

Thrown at src/hotspot/share/adlc/archDesc.cpp:490

  leftstr = rightstr = nullptr;
  // Check for chain rule, and do not generate a match list for it
  if ( mrule->is_chain_rule(_globalNames) ) {
    return;
  }

  // Identify index position among ideal operands
  intptr_t    index     = _last_opcode;
  const char  *indexStr  = getMatchListIndex(*mrule);
  index  = (intptr_t)_idealIndex[indexStr];
  if (index == 0) {
    fprintf(stderr, "Ideal node missing: %s\n", indexStr);
    assert(index != 0, "Failed lookup of ideal node\n");
  }

  // Check that this will be placed appropriately in the DFA
  if (index >= _last_opcode) {
    fprintf(stderr, "Invalid match rule %s <-- ( %s )\n",
            resultStr ? resultStr : " ",
            rootOp    ? rootOp    : " ");
    assert(index < _last_opcode, "Matching item not in ideal graph\n");
    return;
  }


  // Walk the MatchRule, generating MatchList entries for each level
  // of the rule (each nesting of parentheses)
  // Check for "Set"
  if (!strcmp(mrule->_opType, "Set")) {
    mnode = mrule->_rChild;
    buildMList(mnode, rootOp, resultStr, pred, cost);
    return;
  }
  // Build MatchLists for children
  // Check each child for an internal operand name, and use that name
  // for the parent's matchlist entry if it exists

View on GitHub (pinned to 88dfb74bbe)

Solutions

  1. Verify the root operator in the parenthesized match pattern is an ideal node, not an operand class or internal name
  2. Fix any preceding 'Ideal node missing' error first — it is usually the root cause
  3. Rebuild adlc in debug (asserts on) so failures surface deterministically
Defensive patterns

Strategy: validation

Validate before calling

make adlc 2>&1 | tee /tmp/adlc.log; grep -q 'Ideal node missing' /tmp/adlc.log && { echo 'fix root-cause error first'; exit 1; }

Prevention

When it happens

Trigger: A match rule whose rootOp/result resolves to a non-ideal form (e.g. matching on an operand class name or a purely internal form instead of an ideal opcode), or a stale index after [92]'s failed lookup was ignored in a release adlc build.

Common situations: See trigger scenarios.

Related errors


AI-assisted analysis of openjdk/jdk@88dfb74bbe (2026-08-14). Data as JSON: /api/errors/e04505bc1fac4f5b. Report an issue: GitHub.