[Coco] Problems with CC1 optimizations

Retro Canada retrocanada76 at gmail.com
Sat Oct 27 20:44:49 EDT 2012


Hi,

I'm getting problems with the code optmizer. It doesn't work in some
situations, specially with IF-ELSE and variables being
incremented/decremented.

Dou you have such problems too ? I need to compile with -O :(

like the snippet below doesn't even step inside the while:

			while(buf_pos > 0)
			{
				buf_pos--;
				if (x-- == 0 || work_buf[buf_pos] == 0x0D)
				{
					buf_pos++;
					step += 1;
					x = scrn_siz.col;
					break;
				}
			}

but If I do it instead:

			while(buf_pos-- > 0)
			{
				if (x-- == 0 || work_buf[buf_pos] == 0x0D)
				{
					buf_pos++;
					step += 1;
					x = scrn_siz.col;
					break;
				}
			}

it works.

-- 
Panasonic FSA1-WSX
Commodore 64
Commodore 64C
Commodore 128
Apple //c
TRS-Color Computer 3
TI-99/4A
..and more coming!



More information about the Coco mailing list