summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-14 16:25:36 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-14 16:25:36 +0000
commite90391905accdac73e5f34da1ea4a7d97ce179d1 (patch)
tree72e1faa1b66f9c943d6e2c2fa17de7b0761bbfca /gcc/toplev.c
parentfa21d1286ce759993833f865b5307aa55d2fd49d (diff)
downloadgcc-e90391905accdac73e5f34da1ea4a7d97ce179d1.tar.gz
* 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.. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54617 138bc75d-0d04-0410-961f-82ee72b054a4
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 c878d57fc75..7965059f37f 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 ());