Repository navigation
Description
Confirmed PR regression / merge blocker
PR #486 head 6fb6ed7 preserves casts in asm operands instead of silently discarding their tokens. The standalone asm LLVM lowering path still uses a restricted, duplicated operand evaluator, so valid existing macOS time-provider code now fails during code generation.
Native macOS ARM64 CI checked all 248 corpus sources successfully, then ran 24/26 std examples successfully. examples/std/time.wave and examples/std/datetime_roundtrip.wave fail with:
E9001: compiler internal error during code generation
Unsupported asm operand expression: Cast { expr: Variable("info"), target_type: Int(64) }
compiler panic location: llvm/src/statement/asm.rs:557:14
Failing native build job. The native macOS ARM64 cases job also has one failure with the identical Cast { expr: Variable("info"), target_type: Int(64) } panic.
Reproduce without a macOS host
After building #486 with the AArch64 backend available:
target/release/wavec build examples/std/time.wave \
--target aarch64-apple-darwin --emit=ir --out-dir /tmp/wave-macos-timeThis reproduces the same Unsupported asm operand expression: Cast on Linux before linking, so contributors do not need a macOS SDK to start investigating.
Root-cause evidence
front/parser/src/parser/asm.rsnow uses the common expression parser for operands.llvm/src/statement/asm.rs::asm_operand_to_valueaccepts a limited set of AST shapes and rejectsCast.- That helper also parses integer operands as decimal only, bypassing the shared numeric conversion path.
- The expression-asm path in
llvm/src/expression/rvalue/asm.rsalready evaluates inputs through the general expression generator; compare the two paths before adding another partial evaluator.
Acceptance
- Standalone asm lowers the semantically accepted input expressions through typed expression codegen, including pointer-to-integer casts and radix literals.
- Add cross-target regressions that emit IR/objects for the existing macOS time providers and focused asm input examples.
- Preserve register-width coercion, signedness, constraint validation and side-effect evaluation order.
- Both failing std examples pass on native macOS CI, and the Linux/std/ABI regressions remain green.
- Do not remove the casts from std, resume parser token skipping or skip the failing examples.
This must be resolved before merging #486. It is not labeled a good first issue because it crosses typed expression lowering and asm register/ABI contracts.
Additional native evidence
The macOS amd64 build job also fails both time/datetime examples with the identical unsupported Cast panic. This is shared standalone asm lowering, not an ARM64-only defect. The ARM64 case failure is tests/cases/macos/arm64/test1.wave (122 passed / 1 failed).
Activity