{"record":{"id":"cdd5b363ade7c94c","repo":"openjdk/jdk","slug":"s-found-d-semantic-error","errorCode":null,"errorMessage":"%s:  Found %d semantic error","messagePattern":"(.+?):  Found (.+?) semantic error","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/hotspot/share/adlc/adlparse.cpp","lineNumber":68,"sourceCode":"#ifndef ASSERT\n  if (!_AD._quiet_mode) {\n    fprintf(stderr, \"**************************************************************\\n\");\n    fprintf(stderr, \"***** WARNING: ASSERT is undefined, assertions disabled. *****\\n\");\n    fprintf(stderr, \"**************************************************************\\n\");\n  }\n#endif\n  if( _AD._syntax_errs + _AD._semantic_errs + _AD._warnings == 0 ) {\n    if (!_AD._quiet_mode)\n      fprintf(stderr,\"No errors or warnings to report from phase-1 parse.\\n\" );\n  }\n  else {\n    if( _AD._syntax_errs ) {      // Any syntax errors?\n      fprintf(stderr,\"%s:  Found %d syntax error\", _buf._fp->_name, _AD._syntax_errs);\n      if( _AD._syntax_errs > 1 ) fprintf(stderr,\"s.\\n\\n\");\n      else fprintf(stderr,\".\\n\\n\");\n    }\n    if( _AD._semantic_errs ) {    // Any semantic errors?\n      fprintf(stderr,\"%s:  Found %d semantic error\", _buf._fp->_name, _AD._semantic_errs);\n      if( _AD._semantic_errs > 1 ) fprintf(stderr,\"s.\\n\\n\");\n      else fprintf(stderr,\".\\n\\n\");\n    }\n    if( _AD._warnings ) {         // Any warnings?\n      fprintf(stderr,\"%s:  Found %d warning\", _buf._fp->_name, _AD._warnings);\n      if( _AD._warnings > 1 ) fprintf(stderr,\"s.\\n\\n\");\n      else fprintf(stderr,\".\\n\\n\");\n    }\n  }\n  if (!_AD._quiet_mode)\n    fprintf(stderr,\"-----------------------------------------------------------------------------\\n\");\n  _AD._TotalLines += linenum()-1;     // -1 for overshoot in \"nextline\" routine\n\n  // Write out information we have stored\n  // // UNIXism == fsync(stderr);\n}\n\n//------------------------------parse------------------------------------------","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/openjdk/jdk/blob/88dfb74bbeefcf2b0aa11835183bcd949998fc8f/src/hotspot/share/adlc/adlparse.cpp#L50-L86","documentation":"Phase-1 ADLC summary line '\"%s: Found %d semantic error(s).\"' printed when _AD._semantic_errs > 0. Unlike syntax errors, the .ad text parsed but violated ADL semantics: duplicate definitions, undeclared operand/instruction references, bad register class references, misuse of interface components. Output files are suppressed/invalid until errors reach zero.","triggerScenarios":"Semantic checks in ADLParser (e.g. referencing an operand class before declaration, redefining an instruction encoding, wrong pipe description) increment _AD._semantic_errs; this message aggregates them at end of parse.","commonSituations":"Adding a new operand but forgetting its definition; renaming an instruction without updating all match/encode references; .ad files written against an older HotSpot ADL semantic set.","solutions":["Read the individual semantic error lines above the summary; each names the construct","Declare any missing operands/instructions/register classes before first use","Cross-check identifier spelling between operand definitions, match rules, and encode blocks","Rebuild and iterate until 'No errors or warnings to report from phase-1 parse.'"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# ensure every operand referenced in match rules is defined\nfor name in $(grep -oP 'match\\(\\s*\\(\\s*\\w+' -m0 src/hotspot/cpu/x86/x86.ad); do :; done # see scripts; rely on adlc itself","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Define operands/register classes before referencing them","Keep a known-good .ad baseline to diff against","Treat identifier renames as touching all match/encode sites"],"tags":["adlc","semantic-error","build","hotspot","parser"],"backgroundTag":null,"analyzedSha":"88dfb74bbeefcf2b0aa11835183bcd949998fc8f","analyzedAt":"2026-08-14T11:45:09.665Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}