jasmin-lang / jasmin

Language for high-assurance and high-speed cryptography
MIT License
249 stars 52 forks source link

-pliveness can be too late #845

Open eponier opened 2 months ago

eponier commented 2 months ago

It can happen that reg alloc fails before the printing of liveness, making it hard to debug. For instance, it happens for the code here.

EDIT: I changed "crashes" with "fails", it corresponds more to what happens

vbgl commented 2 months ago

Can you please elaborate? What is the error in that case?

eponier commented 2 months ago
compilation error:
register allocation: conflicting variables “pstate.12972” and “a.9970” must be merged due to:
...
eponier commented 2 months ago

Before the call to greedy_allocation, there are multiple collect_conflict functions (opn, intra-procedural, return address, inter-procedural, syscalls). If it fails in one of these functions, the liveness info is not printed.

vbgl commented 2 months ago

In the particular example, do you really think that liveness information can help fixing the issue?

However, I do agree that it would be nice to be able to access the liveness information even if there are other issues.

It might be worth collecting all errors that might be trigger by those “collect conflict” functions and print them all together after the printing of the liveness information.