News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Bug in the compiler/optimizer

Started by LooZee, November 20, 2019, 08:15:53 PM

Previous topic - Next topic

LooZee

Hi Pelle,

I found a bug and set up a small program to reproduce it. I noticed it when compiling the vbcc C-Compiler with PellesC. Given the -Os option, PellesC produces incorrect code in this case. Please see the attached lexer.c file. It is part of the ucpp Preprocessor embedded in vbcc. I preprocessed it, so it can simply be compiled with "cc lexer.c" and "cc -Os lexer.c" without additional dependencies.

There is a #define to enable/disable the bug and the program outputs a binary file ("cppm.log"). The output should always be the same (starting with 0x27000000), but it changes with different optimization options (to 0x22000000).

I hope this helps.

Pelle

OK, I can reproduce. I will look at it...
/Pelle