Pelles C forum

Pelles C => Bug reports => Topic started by: George99 on June 05, 2011, 05:23:20 PM

Title: Compiler flaw when optimizing
Post by: George99 on June 05, 2011, 05:23:20 PM
Code: [Select]
#include <stdio.h>

unsigned testfunc(unsigned n){
return n;
}

void test(unsigned n, unsigned min)
{
unsigned i = 0;
while (n >= min) {
n = testfunc(n);
if (++i > 100)
printf("i greater than 100\n");
}
}

int main(){
test(100,0);
}

This small piece of code should repeat printing "i greater than 100" but by setting any optimization level will stuck.
The problem is the "jnz"-Opcode for testing i against zero.

Tested eith 32bit RC4 6.50