{"record":{"id":"e04505bc1fac4f5b","repo":"openjdk/jdk","slug":"invalid-match-rule-s-s","errorCode":null,"errorMessage":"Invalid match rule %s <-- ( %s )\n","messagePattern":"Invalid match rule (.+?) <-- \\( (.+?) \\)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/hotspot/share/adlc/archDesc.cpp","lineNumber":490,"sourceCode":"\n  leftstr = rightstr = nullptr;\n  // Check for chain rule, and do not generate a match list for it\n  if ( mrule->is_chain_rule(_globalNames) ) {\n    return;\n  }\n\n  // Identify index position among ideal operands\n  intptr_t    index     = _last_opcode;\n  const char  *indexStr  = getMatchListIndex(*mrule);\n  index  = (intptr_t)_idealIndex[indexStr];\n  if (index == 0) {\n    fprintf(stderr, \"Ideal node missing: %s\\n\", indexStr);\n    assert(index != 0, \"Failed lookup of ideal node\\n\");\n  }\n\n  // Check that this will be placed appropriately in the DFA\n  if (index >= _last_opcode) {\n    fprintf(stderr, \"Invalid match rule %s <-- ( %s )\\n\",\n            resultStr ? resultStr : \" \",\n            rootOp    ? rootOp    : \" \");\n    assert(index < _last_opcode, \"Matching item not in ideal graph\\n\");\n    return;\n  }\n\n\n  // Walk the MatchRule, generating MatchList entries for each level\n  // of the rule (each nesting of parentheses)\n  // Check for \"Set\"\n  if (!strcmp(mrule->_opType, \"Set\")) {\n    mnode = mrule->_rChild;\n    buildMList(mnode, rootOp, resultStr, pred, cost);\n    return;\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","sourceCodeStart":472,"sourceCodeEnd":508,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/hotspot/share/adlc/archDesc.cpp#L472-L508","documentation":"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.","triggerScenarios":"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.","commonSituations":"See trigger scenarios.","solutions":["Verify the root operator in the parenthesized match pattern is an ideal node, not an operand class or internal name","Fix any preceding 'Ideal node missing' error first — it is usually the root cause","Rebuild adlc in debug (asserts on) so failures surface deterministically"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"make adlc 2>&1 | tee /tmp/adlc.log; grep -q 'Ideal node missing' /tmp/adlc.log && { echo 'fix root-cause error first'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Fix 'Ideal node missing' before evaluating this error","Ensure the parenthesized root operator is an ideal opcode, not an operand class","Build adlc with asserts enabled during development"],"tags":["adlc","match-rule","build","hotspot","dfa"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}