aboutsummaryrefslogtreecommitdiff
path: root/gcc/invoke.texi
diff options
context:
space:
mode:
authorGeoff Keating <geoffk@cygnus.com>1999-08-18 10:43:26 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>1999-08-18 10:43:26 +0000
commit312f625598f2eed11718c43a649027bc760ef30a (patch)
tree4fb0b080db23c76c2853dadb847aff9aa64d9dc6 /gcc/invoke.texi
parent075ff1b238e01efca6c3a0dc6ddd82046fda4c5a (diff)
downloadgcc-312f625598f2eed11718c43a649027bc760ef30a.zip
gcc-312f625598f2eed11718c43a649027bc760ef30a.tar.gz
gcc-312f625598f2eed11718c43a649027bc760ef30a.tar.bz2
cse.c (cse_insn): Call never_reached_warning when a jump is changed to be unconditional.
* cse.c (cse_insn): Call never_reached_warning when a jump is changed to be unconditional. * flags.h: Declare warn_notreached. * flow.c (delete_block): Call never_reached_warning when a block is deleted. * jump.c (delete_barrier_successors): Call never_reached_warning when we delete everything after a BARRIER. (never_reached_warning): New function. * rtl.h: Declare never_reached_warning. * toplev.c (warn_notreached): New variable. (lang_independent_options): Set warn_notreached when -Wunreachable-code. (compile_file): We need line numbers for -Wunreachable-code. Also modify documentation to suit. From-SVN: r28747
Diffstat (limited to 'gcc/invoke.texi')
-rw-r--r--gcc/invoke.texi25
1 files changed, 23 insertions, 2 deletions
diff --git a/gcc/invoke.texi b/gcc/invoke.texi
index b707cdb..7dadd3f 100644
--- a/gcc/invoke.texi
+++ b/gcc/invoke.texi
@@ -132,8 +132,8 @@ in the following sections.
-Wparentheses -Wpointer-arith -Wredundant-decls
-Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes
-Wswitch -Wtraditional
--Wtrigraphs -Wundef -Wuninitialized -Wunused -Wwrite-strings
--Wunknown-pragmas
+-Wtrigraphs -Wundef -Wuninitialized -Wunknown-pragmas -Wunreachable-code
+-Wunused -Wwrite-strings
@end smallexample
@item Debugging Options
@@ -1766,6 +1766,27 @@ cases where multiple declaration is valid and changes nothing.
@item -Wnested-externs
Warn if an @code{extern} declaration is encountered within an function.
+@item -Wunreachable-code
+Warn if the compiler detects that code will never be executed.
+
+This option is intended to warn when the compiler detects that at
+least a whole line of source code will never be executed, because
+some condition is never satisfied or because it is after a
+procedure that never returns.
+
+It is possible for this option to produce a warning even though there
+are circumstances under which part of the affected line can be executed,
+so care should be taken when removing apparently-unreachable code.
+
+For instance, when a function is inlined, a warning may mean that the
+line is unreachable in only one inlined copy of the function.
+
+This option is not made part of @samp{-Wall} because in a debugging
+version of a program there is often substantial code which checks
+correct functioning of the program and is, hopefully, unreachable
+because the program does work. Another common use of unreachable
+code is to provide behaviour which is selectable at compile-time.
+
@item -Winline
Warn if a function can not be inlined, and either it was declared as inline,
or else the @samp{-finline-functions} option was given.