The convention when a function is going to use a saved register is to save the contents of that register to the stack in case the caller (if there's one? the main function doesn't have one) had been using this register too and to restore the contents right before returning. Is this convention always obeyed? In the case of a really simple program, with just a main function and no other function calls, would the compiler prefer to optimize and disobey the convention, which means no saving before using the saved register? Of course, a convention is not a rule so i was wondering in which situations can these not be followed?
Calling conventions may be called "convention", but they are rules. The reason they are called "convention" is because each compiler uses a different one, once a convention was chosen - it acts as rules.
Regarding the particular case of "main", it's being called by the operating system, so convention must be obyed.