[cc65] optimization bug in rc1

From: Johan Kotlinski <kotlinski1gmail.com>
Date: 2009-10-01 00:24:26
#include <assert.h>
#include <string.h>

typedef unsigned char U8;

char var = 0xf0;
char fn(char bar)
{
    char* ptr = (char*)0xf;
    var |= ptr;
    while (var > bar)
        var <<= 1;
    return 0;
}

void main() {
    fn(0x7f);
    assert(0);
}

Gets stuck in an endless loop with -O.

Cheers,
Johan
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Oct 1 00:24:52 2009

This archive was generated by hypermail 2.1.8 : 2009-10-01 00:24:54 CEST