From aa140b766aa5d0e312e662ca1f2351c7a7c8525a Mon Sep 17 00:00:00 2001 From: jakub Date: Mon, 22 Dec 2008 23:41:17 +0000 Subject: PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142892 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/expr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/expr.h') diff --git a/gcc/expr.h b/gcc/expr.h index f002da2e499..f3f208a141d 100644 --- a/gcc/expr.h +++ b/gcc/expr.h @@ -404,6 +404,7 @@ enum block_op_methods BLOCK_OP_TAILCALL }; +extern tree GTY(()) block_clear_fn; extern void init_block_move_fn (const char *); extern void init_block_clear_fn (const char *); -- cgit v1.2.1