openjdk/jdk · critical

error: operand \"%s\" not found

Error message

error: operand \"%s\" not found

What it means

ArchDesc::buildMList error: while walking a MatchRule tree to build MatchLists, a leaf/node operator name was not found in _idealIndex ('error: operand "name" not found'). The referenced operand or opcode does not exist as a declared form, so ADLC cannot index it into the match DFA; assert(0) follows in debug adlc.

Source

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

  const char *resultop;
  const char *opcode;
  MatchNode  *mnode;
  Form       *form;

  leftstr = rightstr = nullptr;
  // Do not process leaves of the Match Tree if they are not ideal
  if ((node) && (node->_lChild == nullptr) && (node->_rChild == nullptr) &&
      ((form = (Form *)_globalNames[node->_opType]) != nullptr) &&
      (!form->ideal_only())) {
    return;
  }

  // Identify index position among ideal operands
  intptr_t index = _last_opcode;
  const char *indexStr = node ? node->_opType : (char *) " ";
  index = (intptr_t)_idealIndex[indexStr];
  if (index == 0) {
    fprintf(stderr, "error: operand \"%s\" not found\n", indexStr);
    assert(0, "fatal error");
  }

  if (node == nullptr) {
    fprintf(stderr, "error: node is null\n");
    assert(0, "fatal error");
  }
  // 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
  mnode = node->_lChild;
  if (mnode) {
    buildMList(mnode, nullptr, nullptr, nullptr, nullptr);
    leftstr = mnode->_internalop ? mnode->_internalop : mnode->_opType;
  }
  mnode = node->_rChild;
  if (mnode) {
    buildMList(mnode, nullptr, nullptr, nullptr, nullptr);

View on GitHub (pinned to 88dfb74bbe)

Solutions

  1. Search the .ad file(s) for the quoted name: if absent, add the operand/opcode definition or fix the spelling
  2. Ensure referenced operands are defined before the instruction that uses them
  3. Diff against the platform you copied the rule from to find missing definitions
Defensive patterns

Strategy: validation

Validate before calling

# every operand used inside match/encode must have an operand definition in some .ad
for f in $(ls *.ad); do for op in $(grep -oP '(?<=match\()[\\w%]+' $f | tr -d '%'); do grep -q "operand $op\|instruct.*$op" *.ad || echo "undefined: $op"; done; done

Prevention

When it happens

Trigger: A match rule referencing an operand/opcode identifier that is misspelled or never defined in the .ad source, including children of compound rules. buildMList recurses into _lChild/_rChild and looks each _opType up; a null/unknown lookup prints this.

Common situations: Adding new instruction match rules without adding the operand definition; renames that missed one usage; copying a rule from another platform file whose operands do not exist here.

Related errors


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