Menu

#714 warning: conditional flow changed by optimizer: so said EVEL

closed-fixed
5
2013-05-25
2004-02-22
Slade Rich
No

The latest SDCC built from CVS head is giving me an
error (Note was not a problem 3 weeks eariler). Using
the following code with "sdcc -S -V -mz80" get
warning: conditional flow changed by optimizer: so said
EVELYN the modified DOG
warning: unreachable code

unsigned short Secs;

// ----------------------------------------------------
------------------------
// Return True if it has timed out
char IsTimedOut(unsigned short timeOut) {
unsigned short diff = Secs - timeOut;
return (diff & 0x8000) ? 0 : 1;
}

// ----------------------------------------------------
------------------------
void main(void) {
IsTimedOut(0);
}

Hope you can help,
Thank you
Slade
slade_rich@users.sourceforge.net

Discussion

  • Erik Petrich

    Erik Petrich - 2004-02-23
    • assigned_to: epetrich --> nobody
     
  • Erik Petrich

    Erik Petrich - 2004-02-23

    Logged In: YES
    user_id=635249

    This looks like a bug in the new type flow code, since (diff
    & 0x8000) is being cast to the function's return type before
    being evaluated. I suspect Bernhard would know how to fix
    this faster (this is not a z80 specific bug).

     
  • Slade Rich

    Slade Rich - 2004-02-23
    • assigned_to: nobody --> bernhardheld
     
  • Bernhard Held

    Bernhard Held - 2004-02-23

    Logged In: YES
    user_id=203539

    Fixed in SDCCast.c 1.224

     
  • Bernhard Held

    Bernhard Held - 2004-02-23
    • milestone: --> fixed
    • status: open --> closed-fixed
     

Log in to post a comment.