aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@wasabisystems.com>2004-01-23 21:05:21 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2004-01-23 21:05:21 +0000
commite129d93a7b1eda6ee734fff7aa1f8bc60e5ba7e2 (patch)
tree1957c990b77f48c80e149663c064a9f71d8e783a /gcc/toplev.c
parentf6c930a38a5633c4880f572feaddfce14b45951b (diff)
downloadgcc-e129d93a7b1eda6ee734fff7aa1f8bc60e5ba7e2.zip
gcc-e129d93a7b1eda6ee734fff7aa1f8bc60e5ba7e2.tar.gz
gcc-e129d93a7b1eda6ee734fff7aa1f8bc60e5ba7e2.tar.bz2
re PR target/1532 (-O3 generates (obviously) redundant tests and jumps)
PR gcc/1532 * cse.c (cse_change_cc_mode): New static function. (cse_change_cc_mode_insns, cse_cc_succs): Likewise. (cse_condition_code_reg): New function. * rtl.h (cse_condition_code_reg): Declare. * toplev.c (rest_of_handle_cse2): Call cse_condition_code_reg. * target.h (struct gcc_target): Add fixed_condition_code_regs and cc_modes_compatible. * target-def.h (TARGET_FIXED_CONDITION_CODE_REGS): Define. (TARGET_CC_MODES_COMPATIBLE): Define. (TARGET_INITIALIZER): Add new initializers. * targhooks.c (default_cc_modes_compatible): New function. * targhooks.c (default_cc_modes_compatible): Declare. * hooks.c (hook_bool_intp_intp_false): New function. * hooks.h (hook_bool_intp_intp_false): Declare. * config/i386/i386.c (TARGET_FIXED_CONDITION_CODE_REGS): Define. (TARGET_CC_MODES_COMPATIBLE): Define. (ix86_fixed_condition_code_regs): New static function. (ix86_cc_modes_compatible): Likewise. * doc/tm.texi (Condition Code): Document new hooks. From-SVN: r76454
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 05e753a..4d16201 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -2902,6 +2902,13 @@ rest_of_handle_cse2 (tree decl, rtx insns)
dump_flow_info (rtl_dump_file);
/* CFG is no longer maintained up-to-date. */
tem = cse_main (insns, max_reg_num (), 1, rtl_dump_file);
+
+ /* Run a pass to eliminate duplicated assignments to condition code
+ registers. We have to run this after bypass_jumps, because it
+ makes it harder for that pass to determine whether a jump can be
+ bypassed safely. */
+ cse_condition_code_reg ();
+
purge_all_dead_edges (0);
delete_trivially_dead_insns (insns, max_reg_num ());