From: SourceForge.net <no...@so...> - 2003-03-26 13:04:30
|
Bugs item #477927, was opened at 2001-11-04 03:16 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=477927&group_id=599 Category: Live range problems >Group: unreproducable >Status: Closed >Resolution: Out of Date Priority: 5 Submitted By: Michael Hope (michaelh) >Assigned to: Johan Knol (johanknol) Summary: Un-inited variables in while loops Initial Comment: See the regression tests under this bug number. Basically in: int a; do { b = fun(); if (something on b) { a = ++array[b]; } } while (a != 123) a is not initalised in all paths to the while conditional, but sdcc doesn't throw a warning. What's really funky is that as 'a' is not inited before entering the while, 'a' only lives while in the do loop, and it can take on a random value depending on what other iTemps it shares registers with, causing the while condition to fail unpredictibly. I don't know what the fix should be or if it should be fixed. ---------------------------------------------------------------------- >Comment By: Johan Knol (johanknol) Date: 2003-03-26 13:18 Message: Logged In: YES user_id=63512 This cannot be reproduced in latest cvs ---------------------------------------------------------------------- Comment By: Donald Delmar Davis (ddd7) Date: 2002-05-26 17:58 Message: Logged In: YES user_id=537284 I am finding that it doesnt bother to initialize ints in general. sdcc 2.3.0 for the 8051 takes this. ------ snip TL1 = 0x88; TH1 = 0x88; /* ~400 */ /* * Initialize variables for stepper movement */ rstg=0; //unsigned int lstg=300; //unsigned int rphase=0; //unsigned char lphase=0; //unsigned char ------- endsnip And produces this ------- snip ; stepper.c 100 mov _TL1,#0x88 mov _TH1,#0x88 ; stepper.c 107 mov _rphase,#0x00 ; stepper.c 108 mov _lphase,#0x00 ; stepper.c 109 ---- endsnip I'D SAY THIS IS A PRETTY BIG BUG!!! .... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=477927&group_id=599 |