Commit b6d24183 by Jeffrey A Law Committed by Jeff Law

invoke.texi: Document -fdelete-null-pointer-checks

        * invoke.texi: Document -fdelete-null-pointer-checks
        * toplev.c (flag_delete_null_pointer_checks): New.
        (f_options): Add entry for -fdelete-null-pointer-checks.
        (rest_of_compilation): Conditionalize null pointer check
        elimination on flag_delete_null_pointer_checks.
        (main): If -O2 or greater, enable -fdelete-null-pointer-checks

From-SVN: r29631
parent 0cffaca3
Thu Sep 23 13:55:21 1999 Jeffrey A Law (law@cygnus.com)
* invoke.texi: Document -fdelete-null-pointer-checks
* toplev.c (flag_delete_null_pointer_checks): New.
(f_options): Add entry for -fdelete-null-pointer-checks.
(rest_of_compilation): Conditionalize null pointer check
elimination on flag_delete_null_pointer_checks.
(main): If -O2 or greater, enable -fdelete-null-pointer-checks
1999-09-23 10:56 -0700 Zack Weinberg <zack@bitmover.com> 1999-09-23 10:56 -0700 Zack Weinberg <zack@bitmover.com>
* iso646.h, stdarg.h, stdbool.h, stddef.h, varargs.h: Add * iso646.h, stdarg.h, stdbool.h, stddef.h, varargs.h: Add
......
...@@ -153,7 +153,7 @@ in the following sections. ...@@ -153,7 +153,7 @@ in the following sections.
-falign-functions=@var{n} -falign-labels=@var{n} -falign-loops=@var{n} -falign-functions=@var{n} -falign-labels=@var{n} -falign-loops=@var{n}
-falign-jumps=@var{n} -fbranch-probabilities -falign-jumps=@var{n} -fbranch-probabilities
-fcaller-saves -fcse-follow-jumps -fcse-skip-blocks -fcaller-saves -fcse-follow-jumps -fcse-skip-blocks
-fdelayed-branch -fexpensive-optimizations -fdelayed-branch -fdelete-null-pointer-checks -fexpensive-optimizations
-ffast-math -ffloat-store -fforce-addr -fforce-mem -fno-math-errno -ffast-math -ffloat-store -fforce-addr -fforce-mem -fno-math-errno
-fdata-sections -ffunction-sections -fgcse -fdata-sections -ffunction-sections -fgcse
-finline-functions -finline-limit=@var{n} -fkeep-inline-functions -finline-functions -finline-limit=@var{n} -fkeep-inline-functions
...@@ -2459,6 +2459,14 @@ Run the loop optimizer twice. ...@@ -2459,6 +2459,14 @@ Run the loop optimizer twice.
Perform a global common subexpression elimination pass. Perform a global common subexpression elimination pass.
This pass also performs global constant and copy propagation. This pass also performs global constant and copy propagation.
@item -fdelete-null-pointer-checks
Use global dataflow analysis to identify and eliminate useless null
pointer checks. Programs which rely on NULL pointer dereferences @emph{not}
halting the program may not work properly with this option. Use
-fno-delete-null-pointer-checks to disable this optimizing for programs
which depend on that behavior.
@item -fexpensive-optimizations @item -fexpensive-optimizations
Perform a number of minor optimizations that are relatively expensive. Perform a number of minor optimizations that are relatively expensive.
......
...@@ -568,6 +568,11 @@ int flag_syntax_only = 0; ...@@ -568,6 +568,11 @@ int flag_syntax_only = 0;
static int flag_gcse; static int flag_gcse;
/* Nonzero means to use global dataflow analysis to eliminate
useless null pointer tests. */
static int flag_delete_null_pointer_checks;
/* Nonzero means to rerun cse after loop optimization. This increases /* Nonzero means to rerun cse after loop optimization. This increases
compilation time about 20% and picks up a few more common expressions. */ compilation time about 20% and picks up a few more common expressions. */
...@@ -894,6 +899,8 @@ lang_independent_options f_options[] = ...@@ -894,6 +899,8 @@ lang_independent_options f_options[] =
"Run CSE pass after loop optimisations"}, "Run CSE pass after loop optimisations"},
{"rerun-loop-opt", &flag_rerun_loop_opt, 1, {"rerun-loop-opt", &flag_rerun_loop_opt, 1,
"Run the loop optimiser twice"}, "Run the loop optimiser twice"},
{"delete-null-pointer-checks", &flag_delete_null_pointer_checks, 1,
"Delete useless null pointer checks" },
{"pretend-float", &flag_pretend_float, 1, {"pretend-float", &flag_pretend_float, 1,
"Pretend that host and target use the same FP format"}, "Pretend that host and target use the same FP format"},
{"schedule-insns", &flag_schedule_insns, 1, {"schedule-insns", &flag_schedule_insns, 1,
...@@ -3707,7 +3714,7 @@ rest_of_compilation (decl) ...@@ -3707,7 +3714,7 @@ rest_of_compilation (decl)
goto exit_rest_of_compilation; goto exit_rest_of_compilation;
/* Try to identify useless null pointer tests and delete them. */ /* Try to identify useless null pointer tests and delete them. */
if (optimize > 1) if (flag_delete_null_pointer_checks)
TIMEVAR (jump_time, delete_null_pointer_checks (get_insns ())); TIMEVAR (jump_time, delete_null_pointer_checks (get_insns ()));
/* Dump rtl code after jump, if we are doing that. */ /* Dump rtl code after jump, if we are doing that. */
...@@ -3746,7 +3753,7 @@ rest_of_compilation (decl) ...@@ -3746,7 +3753,7 @@ rest_of_compilation (decl)
!JUMP_AFTER_REGSCAN)); !JUMP_AFTER_REGSCAN));
/* Try to identify useless null pointer tests and delete them. */ /* Try to identify useless null pointer tests and delete them. */
if (optimize > 1) if (flag_delete_null_pointer_checks)
TIMEVAR (jump_time, delete_null_pointer_checks (get_insns ())); TIMEVAR (jump_time, delete_null_pointer_checks (get_insns ()));
/* Dump rtl code after cse, if we are doing that. */ /* Dump rtl code after cse, if we are doing that. */
...@@ -5322,6 +5329,7 @@ main (argc, argv) ...@@ -5322,6 +5329,7 @@ main (argc, argv)
#endif #endif
flag_regmove = 1; flag_regmove = 1;
flag_strict_aliasing = 1; flag_strict_aliasing = 1;
flag_delete_null_pointer_checks = 1;
} }
if (optimize >= 3) if (optimize >= 3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment