+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>
* iso646.h, stdarg.h, stdbool.h, stddef.h, varargs.h: Add
-falign-functions=@var{n} -falign-labels=@var{n} -falign-loops=@var{n}
-falign-jumps=@var{n} -fbranch-probabilities
-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
-fdata-sections -ffunction-sections -fgcse
-finline-functions -finline-limit=@var{n} -fkeep-inline-functions
Perform a global common subexpression elimination pass.
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
Perform a number of minor optimizations that are relatively expensive.
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
compilation time about 20% and picks up a few more common expressions. */
"Run CSE pass after loop optimisations"},
{"rerun-loop-opt", &flag_rerun_loop_opt, 1,
"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 that host and target use the same FP format"},
{"schedule-insns", &flag_schedule_insns, 1,
goto exit_rest_of_compilation;
/* 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 ()));
/* Dump rtl code after jump, if we are doing that. */
!JUMP_AFTER_REGSCAN));
/* 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 ()));
/* Dump rtl code after cse, if we are doing that. */
#endif
flag_regmove = 1;
flag_strict_aliasing = 1;
+ flag_delete_null_pointer_checks = 1;
}
if (optimize >= 3)