Calling a C function with too few register parameters is undefined behavior; on Itanium, it can raise a hardware exception due to the NaT bit mechanism.
Key Takeaways
On stack-based calling conventions, under-passing parameters risks stack imbalance or memory corruption in the caller’s frame.
On register-based architectures, the callee reads whatever uninitialized value sits in that register, which is silently wrong but usually survivable.
Itanium’s NaT (Not a Thing) bit marks registers with invalid speculative-load results; spilling a NaT register to memory raises a NaT consumption exception.
Itanium’s architectural frame mechanism means a leaf function’s entire stack frame is sized to the declared inbound parameter count; reading outside that frame is undefined and can fault.
Writing to a stacked register outside the current frame on Itanium is required to raise an Illegal Operation fault, unlike any other common architecture.