{"record":{"id":"409bb9f17deac225","repo":"openjdk/jdk","slug":"no-format-defined-for-s","errorCode":null,"errorMessage":"No format defined for %s\n","messagePattern":"No format defined for (.+?)\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hotspot/share/adlc/formssel.cpp","lineNumber":2571,"sourceCode":"  if (_matrule && (_matrule->is_base_register(globals) ||\n                   strcmp(ideal_type(globalAD->globalNames()), \"RegFlags\") == 0)) {\n    // !!!!! !!!!!\n    fprintf(fp,\"  { char reg_str[128];\\n\");\n    fprintf(fp,\"    ra->dump_register(node,reg_str, sizeof(reg_str));\\n\");\n    fprintf(fp,\"    st->print(\\\"%cs\\\",reg_str);\\n\",'%');\n    fprintf(fp,\"  }\\n\");\n  } else if (_matrule && (dtype = _matrule->is_base_constant(globals)) != Form::none) {\n    format_constant( fp, index, dtype );\n  } else if (ideal_to_sReg_type(_ident) != Form::none) {\n    // Special format for Stack Slot Register\n    fprintf(fp,\"  { char reg_str[128];\\n\");\n    fprintf(fp,\"    ra->dump_register(node,reg_str, sizeof(reg_str));\\n\");\n    fprintf(fp,\"    st->print(\\\"%cs\\\",reg_str);\\n\",'%');\n    fprintf(fp,\"  }\\n\");\n  } else {\n    fprintf(fp,\"  st->print(\\\"No format defined for %s\\n\\\");\\n\", _ident);\n    fflush(fp);\n    fprintf(stderr,\"No format defined for %s\\n\", _ident);\n    dump();\n    assert( false,\"Internal error:\\n  output_internal_operand() attempting to output other than a Register or Constant\");\n  }\n}\n\n// Similar to \"int_format\" but for cases where data is external to operand\n// external access to reg# node->in(idx)->_idx,\nvoid  OperandForm::ext_format(FILE *fp, FormDict &globals, uint index) {\n  Form::DataType dtype;\n  if (_matrule && (_matrule->is_base_register(globals) ||\n                   strcmp(ideal_type(globalAD->globalNames()), \"RegFlags\") == 0)) {\n    fprintf(fp,\"  { char reg_str[128];\\n\");\n    fprintf(fp,\"    ra->dump_register(node->in(idx\");\n    if ( index != 0 ) fprintf(fp,              \"+%d\",index);\n    fprintf(fp,                                      \"),reg_str,sizeof(reg_str));\\n\");\n    fprintf(fp,\"    st->print(\\\"%cs\\\",reg_str);\\n\",'%');\n    fprintf(fp,\"  }\\n\");\n  } else if (_matrule && (dtype = _matrule->is_base_constant(globals)) != Form::none) {","sourceCodeStart":2553,"sourceCodeEnd":2589,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/hotspot/share/adlc/formssel.cpp#L2553-L2589","documentation":"The ADL compiler, while emitting the debug/output code for an operand (output_internal_operand), hit an operand class that is neither a register, nor a base constant, nor a stack-slot register class. It emits 'No format defined for <operand>' into both the generated file and stderr, dumps the operand, and then asserts (assert(false, \"Internal error...\")) — so in release adlc builds it silently produces a broken format function, in debug builds adlc aborts.","triggerScenarios":"Declaring an operand in a .ad file with no matrule, or with a matrule that is not a base register / base constant, and whose name does not map to a special register (sReg) type via ideal_to_sReg_type. Any operand that reaches output_internal_operand without matching one of the three supported shapes triggers it.","commonSituations":"Adding a new opaque/interface operand (e.g. for a predicate or runtime constant) without giving it a matrule; redefining an existing operand's matrule; typos in ideal type names so the matrule is parsed as 'none'.","solutions":["Look at the dump() output right after the message to identify the offending operand name","Give the operand a proper matrule: a register form (match base register class), a constant form (match constant type), or a stack-slot register (sReg) name","If the operand is only used as an interface/placeholder, make sure it is never passed through int_format/output paths — or model it as a constant/register explicitly","Rebuild the adlc-generated sources; the assert only fires in debug adlc, so also grep the generated ad_<arch>.cpp for 'No format defined' to catch it in release builds"],"exampleFix":"// before\noperand myOpnd(%g globalReg) %{ match(Reg); %} // malformed/missing matrule\n\n// after\noperand myOpnd() %{ match(RegI); op_cost(0); format %{ \"%%myOpnd\" %} interface(CONST_REG); %}","handlingStrategy":"validation","validationCode":"# After codegen, assert the generated formatter has no placeholder:\ngrep -R \"No format defined\" build/*/hotspot/variances/*/ad_* || echo OK","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always give new operands a matrule (register, constant) or name them as a stack-slot register type","Build with a debug (asserting) adlc at least once when changing operand definitions","Grep generated sources for the placeholder string in release pipelines where the assert is compiled out"],"tags":["hotspot","adlc","ad-file","operand","assert","codegen"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}