Using saved registers at the main function with no other function calls [RISC-V]
Calling conventions may be called &quot;convention&quot;, but they are rules. The reason they are called &quot;convention&quot; is because each compiler uses a different one, once a convention was chosen - it acts as rules.
Regarding the particular case of &quot;main&quot;, it's being called by the operating system, so convention must be obyed.