This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/17544] [4.0 Regression] incorrect -Wunreachable-code warning for mains with a return statement


------- Additional Comments From steven at gcc dot gnu dot org  2004-12-22 22:34 -------
Spot the bug: 
 
main () 
{ 
  intD.0 D.1384; 
 
  # BLOCK 0, starting at line 3 
  # PRED: ENTRY 
  [t.c : 3] D.1384 = 0; 
  [t.c : 3] goto <bb 2> (<L0>); 
  # SUCC: 2 
 
  # BLOCK 1, starting at line 4 
  # PRED: 
  [t.c : 4] D.1384 = 0; 
  # SUCC: 2 
 
  # BLOCK 2 
  # PRED: 0 1 
<L0>:; 
  return D.1384; 
  # SUCC: EXIT 
 
} 
 
Note how the compiler generated "return 0;" has a locus.  Not giving 
it one should fix it. 
 
Testing a patch. 
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17544


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]