Jump to content
IGNORED

Bests options for SDCC compilation


alekmaul

Recommended Posts

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 ?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

--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. ;)

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...