------- Comment #5 from manu at gcc dot gnu dot org 2008-08-18 18:56 ------- possible_bug.cc:1: error: `cMyClass' has not been declared possible_bug.cc: In function `bool Init()': possible_bug.cc:5: error: `some_function' was not declared in this scope possible_bug.cc:5: warning: unused variable 'some_function'
Anyway, I guess the following reproduces the original problem: bool some_function(void); bool Init() { bool retval; if (some_function()) { // If the `goto' is executed, 'return retval;' will use the // uninitialized value of 'retval'. goto error; } retval = true; error: return retval; } which is converted to: bool Init() () { boolD.2365 retvalD.2430; boolD.2365 retval.0D.2432; # BLOCK 2 # PRED: ENTRY (fallthru,exec) [pr36814.C : 7] retval.0D.2432_2 = some_functionD.2427 (); [pr36814.C : 7] retval.0D.2432_3 = retval.0D.2432_2; [pr36814.C : 7] if (retval.0D.2432_3 != 0) goto <bb 4> (error); else goto <bb 3>; # SUCC: 4 (true,exec) 3 (false,exec) # BLOCK 3 # PRED: 2 (false,exec) [pr36814.C : 14] retvalD.2430_5 = 1; # SUCC: 4 (fallthru,exec) # BLOCK 4, starting at line 0 # PRED: 2 (true,exec) 3 (fallthru,exec) # retvalD.2430_1 = PHI <retvalD.2430_4(D)(2), 1(3)> errorL.1: return 1; # SUCC: EXIT } by the first CCP pass. So this is CCP again. *** This bug has been marked as a duplicate of 18501 *** -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |RESOLVED Resolution| |DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36814