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

cvs-commit at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Jan 1 16:15:00 GMT 2005


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2005-01-01 16:15 -------
Subject: Bug 17544

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	steven@gcc.gnu.org	2005-01-01 16:15:24

Modified files:
	gcc            : ChangeLog c-decl.c emit-rtl.c tree-cfg.c 
	gcc/cp         : ChangeLog decl.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/warn: Wunreachable-code-1.C 
	gcc/testsuite/gcc.dg: 20041231-1.c 

Log message:
	* emit-rtl.c (add_insn_before): Fix comment typo.
	
	PR middle-end/17544
	* c-decl.c (finish_function): If compiling C99, annotate the
	compiler generated return with the current file name and line 0.
	* tree-cfg.c (remove_useless_stmts_warn_notreached): Only warn if
	the source line is greater than 0.
	(remove_bb): Likewise.
	
	cp/
	PR middle-end/17544
	* decl.c (finish_function): Fix comment.  Annotate the compiler
	generated return with the current file name and line 0.
	
	testsuite/
	* gcc.dg/20041231-1.C: New test.
	* g++.dg/warn/Wunreachable-code-1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.6994&r2=2.6995
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.620&r2=1.621
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/emit-rtl.c.diff?cvsroot=gcc&r1=1.432&r2=1.433
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-cfg.c.diff?cvsroot=gcc&r1=2.136&r2=2.137
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4565&r2=1.4566
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1349&r2=1.1350
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4830&r2=1.4831
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/Wunreachable-code-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/20041231-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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



More information about the Gcc-bugs mailing list