openjdk/jdk · warning

-------Warning: total %d unused operands

Error message

-------Warning: total %d unused operands

What it means

Closing line of ADLC's unused-operand lint: after listing each unused operand individually (see [96]), it prints '\n-------Warning: total %d unused operands' with the aggregate count. Purely informational; indicates how many definitions in the preceding list to clean up. Build continues.

Source

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

  callback.do_form_by_name("vecY");
  callback.do_form_by_name("vecZ");
  callback.do_form_by_name("legVecS");
  callback.do_form_by_name("legVecD");
  callback.do_form_by_name("legVecX");
  callback.do_form_by_name("legVecY");
  callback.do_form_by_name("legVecZ");
#endif

  int cnt = 0;
  _operands.reset();
  OperandForm* operand;
  for ( ; (operand = (OperandForm*)_operands.iter()) != nullptr; ) {
    if(visited.find(operand) == visited.end() && !operand->ideal_only()) {
      fprintf(stderr, "\nWarning: unused operand (%s)", operand->_ident);
      cnt++;
    }
  }
  if (cnt) fprintf(stderr, "\n-------Warning: total %d unused operands\n", cnt);

  return true;
}

void ArchDesc::dump() {
  _pre_header.dump();
  _header.dump();
  _source.dump();
  if (_register) _register->dump();
  fprintf(stderr,"\n");
  fprintf(stderr,"------------------ Dump Operands ---------------------\n");
  _operands.dump();
  fprintf(stderr,"\n");
  fprintf(stderr,"------------------ Dump Operand Classes --------------\n");
  _opclass.dump();
  fprintf(stderr,"\n");
  fprintf(stderr,"------------------ Dump Attributes  ------------------\n");
  _attributes.dump();

View on GitHub (pinned to 88dfb74bbe)

Solutions

  1. Treat the count as a checklist: clean up that many definitions per the individual warnings above
  2. Silence by using or removing each operand; verify count drops to zero on rebuild
Defensive patterns

Strategy: validation

Validate before calling

cnt=$(make adlc 2>&1 | grep -oP '(?<=total )\d+(?= unused operands)' || true); [ "${cnt:-0}" -gt 0 ] && echo "clean up $cnt operands"

Prevention

When it happens

Trigger: End of ArchDesc's check_after_parse()/operand usage verification when cnt > 0 — i.e. at least one operand was never visited by the form-callback walk.

Common situations: Same as [96]: experimental or ported .ad files with leftover operand definitions.

Related errors


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