sdcc should try to do these as late as possible. This can shorten live ranges and thus reduce register pressure, etc.
E.g. in the following minimal example:
void foo(int x)
int y = x;
sdcc should move the asssignment beyond the first call to bar().
This optimization should probably be done directly after the computation of live ranges, before register assignment.