From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: "Andrew Davies" Cc: help-gcc@gnu.org Subject: Re: Over optimisation Date: Thu, 30 Sep 1999 23:56:00 -0000 Message-ID: <11660.938097626@upchuck.cygnus.com> References: <01bf05ce$5ca544c0$4f7fa890@us1.lincoln.msl.mitel.com> X-SW-Source: 1999-09n/msg00359.html Message-ID: <19990930235600.IXPFrGN0JO10J0ND0OKbvnjopTfYLCqEBFJBTmkZtZs@z> In message < 01bf05ce$5ca544c0$4f7fa890@us1.lincoln.msl.mitel.com >you write: > 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? There's no way to tell without a complete bug report. Please read the FAQ to learn how to properly send bug reports. jeff