{"record":{"id":"8586a85f70dd01bf","repo":"openjdk/jdk","slug":"error-operand-s-not-found","errorCode":null,"errorMessage":"error: operand \\\"%s\\\" not found\n","messagePattern":"error: operand \\\\\"(.+?)\\\\\" not found\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/hotspot/share/adlc/archDesc.cpp","lineNumber":554,"sourceCode":"  const char *resultop;\n  const char *opcode;\n  MatchNode  *mnode;\n  Form       *form;\n\n  leftstr = rightstr = nullptr;\n  // Do not process leaves of the Match Tree if they are not ideal\n  if ((node) && (node->_lChild == nullptr) && (node->_rChild == nullptr) &&\n      ((form = (Form *)_globalNames[node->_opType]) != nullptr) &&\n      (!form->ideal_only())) {\n    return;\n  }\n\n  // Identify index position among ideal operands\n  intptr_t index = _last_opcode;\n  const char *indexStr = node ? node->_opType : (char *) \" \";\n  index = (intptr_t)_idealIndex[indexStr];\n  if (index == 0) {\n    fprintf(stderr, \"error: operand \\\"%s\\\" not found\\n\", indexStr);\n    assert(0, \"fatal error\");\n  }\n\n  if (node == nullptr) {\n    fprintf(stderr, \"error: node is null\\n\");\n    assert(0, \"fatal error\");\n  }\n  // Build MatchLists for children\n  // Check each child for an internal operand name, and use that name\n  // for the parent's matchlist entry if it exists\n  mnode = node->_lChild;\n  if (mnode) {\n    buildMList(mnode, nullptr, nullptr, nullptr, nullptr);\n    leftstr = mnode->_internalop ? mnode->_internalop : mnode->_opType;\n  }\n  mnode = node->_rChild;\n  if (mnode) {\n    buildMList(mnode, nullptr, nullptr, nullptr, nullptr);","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/hotspot/share/adlc/archDesc.cpp#L536-L572","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Search the .ad file(s) for the quoted name: if absent, add the operand/opcode definition or fix the spelling","Ensure referenced operands are defined before the instruction that uses them","Diff against the platform you copied the rule from to find missing definitions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# every operand used inside match/encode must have an operand definition in some .ad\nfor 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","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Define every operand referenced by a match rule","Copy operand definitions along with instructions when porting between platforms","Rebuild immediately after adding an operand to catch typos early"],"tags":["adlc","operand","match-rule","build","hotspot"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}