aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2002-06-14 10:25:36 -0600
committerJeff Law <law@gcc.gnu.org>2002-06-14 10:25:36 -0600
commit99a15921f00b8d3956a66a39bc98c57893a665f0 (patch)
tree72e1faa1b66f9c943d6e2c2fa17de7b0761bbfca /gcc/toplev.c
parente56c446321eafc7f19e1d7cd0ef0fa2bdfe40b5f (diff)
downloadgcc-99a15921f00b8d3956a66a39bc98c57893a665f0.zip
gcc-99a15921f00b8d3956a66a39bc98c57893a665f0.tar.gz
gcc-99a15921f00b8d3956a66a39bc98c57893a665f0.tar.bz2
gcse.c (delete_null_pointer_checks_1): Inform caller if any null pointer checks were eliminated.
* gcse.c (delete_null_pointer_checks_1): Inform caller if any null pointer checks were eliminated. Update prototype. (delete_null_pointer_checks): Similarly. * rtl.h (delete_null_pointer_checks): Update prototype. * toplev.c (rest_of_compilation): Only run cleanup_cfg if delete_null_pointer_checks deletes one or more null pointer checks. Do not run cleanup_cfg before gcse, the CFG is accurate and optimized at that point.. From-SVN: r54617
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index c878d57..7965059 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2729,9 +2729,9 @@ rest_of_compilation (decl)
if (rtl_dump_file)
dump_flow_info (rtl_dump_file);
- delete_null_pointer_checks (insns);
+ if (delete_null_pointer_checks (insns))
+ cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
- cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
close_dump_file (DFI_null, print_rtl_with_bb, insns);
}
@@ -2775,13 +2775,13 @@ rest_of_compilation (decl)
if (tem || optimize > 1)
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
/* Try to identify useless null pointer tests and delete them. */
- if (flag_delete_null_pointer_checks || flag_thread_jumps)
+ if (flag_delete_null_pointer_checks)
{
timevar_push (TV_JUMP);
if (flag_delete_null_pointer_checks)
- delete_null_pointer_checks (insns);
- /* CFG is no longer maintained up-to-date. */
+ if (delete_null_pointer_checks (insns))
+ cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
timevar_pop (TV_JUMP);
}
@@ -2814,7 +2814,6 @@ rest_of_compilation (decl)
timevar_push (TV_GCSE);
open_dump_file (DFI_gcse, decl);
- cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
tem = gcse_main (insns, rtl_dump_file);
rebuild_jump_labels (insns);
delete_trivially_dead_insns (insns, max_reg_num ());