From: <no...@so...> - 2002-12-05 08:28:20
|
Bugs item #648857, was opened at 2002-12-05 09:28 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=648857&group_id=599 Category: msc51(8051) target Group: None Status: Open Resolution: None Priority: 5 Submitted By: Carsten Pahl (cpschnuffel) Assigned to: Nobody/Anonymous (nobody) Summary: "dead-optimizing" while-loop Initial Comment: Hi there, I have a (little) problem with the optimizing routines of sdcc 2.3.2. A self-written module for the internal UART of an 8051 contains the interrupt service routine, in which I set a module-globale variable if a byte is sended successfully. This variable is a loop condition for the sending routine to wait until the byte is sended. If I compile the module, sdcc says "warning: conditional flow changed by optimizer: so said EVELYN the modified dog" and points to the while loop. Additionally, it gives me two "unreachable code" warnings for code lines after the while loop. Here's a code snippet: ... // This is the flag set by the isr and read by the send routine static unsigned char g_ucTransmitFlag = 0; ... void vUART_ISR(void) interrupt 4 { ... if (TI) { // Here the flag is set g_ucTransmitFlag = 1; // Delete TI TI = 0; } ... } ... // This is the sending routine void vUART_Send(void) { unsigned char ucCounter; ... // send whole buffer ucCounter = 0; do { // send next byte SBUF = g_ucSendBuffer[ucCounter]; // wait until byte transfered while(!g_ucTransmitFlag); g_ucTransmitFlag = 0; // increment counter ucCounter++; } while(ucCounter < g_ucSendSize); ... } I hope somebody can help me to solve the problem without deactivating the whole loop optimization. Best regards Carsten ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=648857&group_id=599 |