Hi Mary-Ann,

> r2 is not then used anywhere, so why does this happen, and is there
> anything I can do to stop it happening?

Try the latest snapshot version of SDCC. It should optimize this.

But in general this can always happen somewhere in your code. The register
was used during code generation as an intermediate and then a peephole
optimization rule removed the read of it as the value is still in the
accumulator. It is much harder to determine it will not be read somewhere
in the future so it is safest to keep the write.

HTH,
Maarten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to