User Activity

  • Posted a comment on ticket #608 on Artistic Style

    My apologies if this belongs to Feature Requests.

  • Created ticket #608 on Artistic Style

    Option --break-blocks separates preprocessor code too

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    That is correct, changing to unsigned fixed it, and it makes sense for the compiler not to make assumptions. My doubt originated because, in a project I'm hired to work on, those optimizations weren't being applied in some code, but it already uses unsigned values. So I guess it must be due to the complexity of the statement (as it's closed source I can't copy it here, but it access a multidimensional array, calls another function...).

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    I was asking, because I had my doubts. I put together this (totally useless) sample code: int array[10] = {45, 78, 15, 39, 57, 93, 3, 63, 12, 77}; void work(int position) { array[position / 2] = array[position % 8]; } void main(void) { work(13); } When I replaced the assignment line with array[position >> 1] = array[position & 7]; I thought it would compile to exactly the same code, but it didn't. Looking at the output ASM it seems no optimization is being done in the first case. Sorry if this is...

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    Hello, I'd like to know if SDCC will optimize things like division and modulo with powers of 2 when the values are known at compile time, like: int a = 116; a = a / 16; // This should equal "a >> 4" int b = 73; b = b % 64; // This should equal "b & 63" And if true, will this too happen with complex expressions involving other variables and operands? Not just those simple assignments. Are these optimizations (like constant folding) only performed if --opt-code-speed is enabled, or always? Thanks.

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    Thanks!

  • Posted a comment on discussion Open Discussion on Small Device C Compiler (SDCC)

    According to the manual, section 3.1.8.8: SDCC will inline functions if and only if they are declared using inline and do not have variable arguments. Can SDCC make functions inline automatically according to some criteria, or will it only do that if the coder uses the inline keyword?

  • Posted a comment on discussion Help on Small Device C Compiler (SDCC)

    Well, it's no big deal, I can always change the file names, or add an empty line, and in any case this only happens when compiling in debug mode, so... Just wanted to know if SDCC han an option to use different symbol naming. It's not that important to me that I'd patch the compiler myself just to compile this project. Thank you.

View All

Personal Data

Username:
savidan
Joined:
2025-05-16 10:04:45.067000

Projects

  • No projects to display.

Personal Tools