Pelles C forum

Pelles C => Bug reports => Topic started by: LooZee on November 20, 2019, 08:15:53 PM

Title: Bug in the compiler/optimizer
Post by: LooZee on November 20, 2019, 08:15:53 PM
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.
Title: Re: Bug in the compiler/optimizer
Post by: Pelle on November 24, 2019, 04:52:52 PM
OK, I can reproduce. I will look at it...