From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andrew Davies" To: help-gcc@gnu.org Subject: Over optimisation Date: Fri, 01 Oct 1999 00:00:00 -0000 Message-ID: <01bf05ce$5ca544c0$4f7fa890@us1.lincoln.msl.mitel.com> X-SW-Source: 1999-q3/msg00764.html Message-ID: <19991001000000.I1OO9e0wH0jY7yB5zsqmbbk3puJrS751MHLbNVUDj5o@z> Hi, I have a problem with the optimiser. When I compile the following test loop: do { test = regbase->utx & 0x8000; }while(test == 0x0000); It produces the following code: send_byte: link.w %a6,#0 move.w 16775430,%d0 and.w #32768,%d0 .even .L9: tst.w %d0 jbeq .L9 I think the optimiser is assuming the line inside the do while loop is static and therefore removes it from the loop. As a result it gets stuck. Anyone know how to solve this without turning the optimiser off? Thanks