alekmaul Posted September 15, 2016 Share Posted September 15, 2016 I'm currently thinking bout best options for C source file compilation with SDCC V3.5. Currently, i'm using : --std-c99 -mz80 --opt-code-size --fverbose-asm --max-allocs-per-node 10000 --vc I also saw that a --opt-code-speed option exists, it is used to optimize more for speed instead of size. is it useful to use it with SDCC V3.5 ? Also, can we use --opt-code-size and --opt-code-speed both for compilation ? Quote Link to comment Share on other sites More sharing options...
PkK Posted September 15, 2016 Share Posted September 15, 2016 Also, can we use --opt-code-size and --opt-code-speed both for compilation ? No. If you use neither, SDCC will try to optimize for some balance between code size and speed. The two options are meant to indicate a preference of code size vs. speed. Philipp Quote Link to comment Share on other sites More sharing options...
PkK Posted September 15, 2016 Share Posted September 15, 2016 I'd recommend to use the latest release, SDCC 3.6.0. While --opt-code-speed exists, and makes a difference in the generated code, don't expect it to do any miracles. Code will typically be a bit, but not much bigger and faster with --opt-code-speed vs. --opt-code-size. Philipp Quote Link to comment Share on other sites More sharing options...
PkK Posted September 15, 2016 Share Posted September 15, 2016 You could also use --allow-unsafe-read (current name, AFAIK it used to be --lospre-usafe-read in older versions), to enable some extra optimizations, but it won't make a big difference either. I never used --vc, I guess it is a matter of preference. For --max-allocs-per-node you might want to choose higher or lower values depending on compilation speed vs. code quality trade-off desired. Philipp 1 Quote Link to comment Share on other sites More sharing options...
alekmaul Posted September 15, 2016 Author Share Posted September 15, 2016 --opt-code-size with sdcc 3.5 does a big difference without it. When I tried sdcc 3.6 some time ago, the code was bigger than with sdcc 3.5 (see here http://atariage.com/forums/topic/253705-sdcc-360-released/?p=3544300).But it was not with code-size option, will try again. Quote Link to comment Share on other sites More sharing options...
Tursi Posted September 15, 2016 Share Posted September 15, 2016 --vc isn't a compilation option, it just changes the formatting of output messages to be something that Visual Studio can parse, so you can click on an error line and go to the line in the source code. (I use it ). I use --opt-code-speed. It makes a difference in some places, but it really depends what you're going for. If I needed to save ROM space, I'd use opt-code-size. Sometimes even a few bytes in a common pattern makes an overall difference. I'm on SDCC 3.5... updating is painful for me since I need to re-hack the linker each time. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.