diff options
author | zadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-07 20:48:07 +0000 |
---|---|---|
committer | zadeck <zadeck@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-07 20:48:07 +0000 |
commit | 9c2a0c05b3929cb733f49c3e4f125a961bf9b07a (patch) | |
tree | b1aaf0884496e7223907dc2c04ecd0cf5ded732f /gcc/rtl.h | |
parent | 582b1949ea35078bbe368033b69067fdb9d5f4f5 (diff) | |
download | gcc-9c2a0c05b3929cb733f49c3e4f125a961bf9b07a.tar.gz |
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
PATCH rtl/7335
PATCH rtl/33826
* see.c (see_copy_insn): Copy new pure const attributes for new
call.
* c-decl.c (merge_decls): Ditto.
* postreload.c (record_opr_changes): Change CONST_OR_PURE_CALL_P
to RTL_CONST_OR_PURE_CALL_P.
* tree.c (define_local_buitin): Rename DECL_IS_PURE to
DECL_PURE_P. Initialized DECL_LOOPING_CONST_PURE.
(process_call_operands): Set tree_side_effects properly.
* tree.h (TREE_READONLY_DECL_P): Removed.
(DECL_IS_PURE): Renamed to DECL_PURE_P.
(DECL_LOOPING_OR_CONST_P): New macro.
(struct tree_function_decl): Added looping_const_or_pure_p.
(ECF_*) Renumbered.
(ECF_LOOPING_OR_CONST_P): New macro,
* rtlanal.c (pure_const_p): Removed.
* builtins.c (expand_builtin): Rename DECL_IS_PURE to DECL_PURE_P.
* reorg.c (delete_prior_computation) Changed CONST_OR_PURE_CALL_P
to RTL_CONST_CALL_P.
* ipa-pure-const.c (pure_const_state_e): Added looping field.
(check_decl, check_tree, check_call, scan_function): Initialize
looping.
(analyze_function): Rename DECL_IS_PURE to DECL_PURE_P.
(static_execute): Set looping true for recursive functions.
Undo setting state to IPA_NEITHER for recursive functions.
* cse.c (cse_insn):
* ifcvt.c (noce_can_store_speculate_p): Changed
CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or
RTL_CONST_OR_PURE_CALL_P.
* dse.c (scan_insn): Ditto.
* local-alloc.c (validate_equiv_mem, memref_used_between_p): Ditto.
* gcse.c (oprs_not_seen_p) Changed CONST_OR_PURE_CALL_P to
RTL_CONST_OR_PURE_CALL_P.
(store_killed_in_insn): Changed CONST_OR_PURE_CALL_P and
pure_call_p to RTL_CONST_CALL_P.
* gimplify.c (gimplify_call_expr): Clear side effects for
non-looping pure and constant calls.
* calls.c (emit_call_1): Set rtl flags from ecf flags.
(flags_from_decl_or_type): Set ecf flags from decl flags.
(initialize_argument_information): Turn off
ECF_LOOPING_CONST_OR_PURE when turning off ECF_CONST.
Change const to pure if callee_copies is true rather than just
turning off const.
(expand_call): Turn off ECF_LOOPING_PURE_CONST_CALL and remove old
way of marking pure calls.
(emit_library_call_value_1): Turn off ECF_LOOPING_PURE_CONST_CALL.
Remove hack that was supposed to fix pr7335 and remove old
way of marking pure calls.
* emit-rtl.c (emit_copy_of_insn_after): Copy RTL_CONST_CALL_P,
RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P.
* cselib.c (cselib_process_insn): Changed CONST_OR_PURE_CALL_P to
RTL_CONST_OR_PURE_CALL_P.
* tree-ssa-pre.c (can_value_number_call): Fixed spacing.
* loop-invariant.c (find_exits, find_invariant_bb): Changed
CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P.
* sched-deps.c (schedule_analyze): Ditto.
* rtl.h (struct rtx_def): Use call field, unchanging field, and
return_val field of calls to represent pure and const function
info.
(CONST_OR_PURE_CALL_P): Deleted macro.
(RTL_CONST_CALL_P, RTL_PURE_CALL_P,
RTL_LOOPING_CONST_OR_PURE_CALL_P, RTL_CONST_OR_PURE_P): New macros.
* tree-inline.c (copy_body_r): Changed TREE_READONLY_DECL_P to
TREE_READONLY.
* tree-optimize.c (execute_fixup_cfg): Added test for
ECF_LOOPING_CONST_OR_PURE.
* c-common.c (handle_pure_attribute): Changed DECL_IS_PURE to
DECL_PURE_P.
* tree-cfg.c (update_call_expr_flags): Do not clear tree side
effects for looping pure or const calls.
(verify_gimple_expr): Added verification code.
* config/alpha/alpha.c (alpha_legitimize_address,
alpha_emit_xfloating_libcall): Changed CONST_OR_PURE_CALL_P to
RTL_CONST_CALL_P.
* config/s390/s390.c (s390_emit_tls_call_insn): Ditto.
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Ditto.
* config/mips/mips.c (mips_call_tls_get_addr): Ditto.
* cfgrtl.c (need_fake_edge_p): Changed CONST_OR_PURE_CALL_P to
RTL_CONST_OR_PURE_CALL_P.
* dce.c (deletable_insn_p): Allow non looping, non sibling, pure
and const calls to be deleted.
java:
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
* decl.c (java_init_decl_processing): Change DECL_IS_PURE to
DECL_PURE_P.
cp:
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
* decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY,
DECL_LOOPING_CONST_OR_PURE_P attributes.
* rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to
DECL_PURE_P.
gfortran:
2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com>
* trans-decl.c (gfc_get_extern_function_decl, build_function_decl):
Rename DECL_IS_PURE to DECL_PURE_P.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135053 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r-- | gcc/rtl.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/gcc/rtl.h b/gcc/rtl.h index aaa1a925a9d..b747a27f592 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -253,14 +253,17 @@ struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"), In a CODE_LABEL, part of the two-bit alternate entry field. */ unsigned int jump : 1; /* In a CODE_LABEL, part of the two-bit alternate entry field. - 1 in a MEM if it cannot trap. */ + 1 in a MEM if it cannot trap. + 1 in a CALL_INSN logically equivalent to + ECF_LOOPING_CONST_OR_PURE and DECL_LOOPING_CONST_OR_PURE_P. */ unsigned int call : 1; /* 1 in a REG, MEM, or CONCAT if the value is set at most once, anywhere. 1 in a SUBREG if it references an unsigned object whose mode has been from a promoted to a wider mode. 1 in a SYMBOL_REF if it addresses something in the per-function constants pool. - 1 in a CALL_INSN, NOTE, or EXPR_LIST for a const or pure call. + 1 in a CALL_INSN logically equivalent to ECF_CONST and TREE_READONLY. + 1 in a NOTE, or EXPR_LIST for a const call. 1 in a JUMP_INSN, CALL_INSN, or INSN of an annulling branch. */ unsigned int unchanging : 1; /* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile. @@ -303,7 +306,8 @@ struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"), unsigned frame_related : 1; /* 1 in a REG or PARALLEL that is the current function's return value. 1 in a MEM if it refers to a scalar. - 1 in a SYMBOL_REF for a weak symbol. */ + 1 in a SYMBOL_REF for a weak symbol. + 1 in a CALL_INSN logically equivalent to ECF_PURE and DECL_PURE_P. */ unsigned return_val : 1; /* The first element of the operands of this rtx. @@ -765,10 +769,24 @@ extern void rtl_check_failed_flag (const char *, const_rtx, const char *, (RTL_FLAG_CHECK6("INSN_DELETED_P", (RTX), INSN, CALL_INSN, JUMP_INSN, \ CODE_LABEL, BARRIER, NOTE)->volatil) +/* 1 if RTX is a call to a const function. Built from ECF_CONST and + TREE_READONLY. */ +#define RTL_CONST_CALL_P(RTX) \ + (RTL_FLAG_CHECK1("RTL_CONST_CALL_P", (RTX), CALL_INSN)->unchanging) + +/* 1 if RTX is a call to a pure function. Built from ECF_PURE and + DECL_PURE_P. */ +#define RTL_PURE_CALL_P(RTX) \ + (RTL_FLAG_CHECK1("RTL_PURE_CALL_P", (RTX), CALL_INSN)->return_val) + /* 1 if RTX is a call to a const or pure function. */ -#define CONST_OR_PURE_CALL_P(RTX) \ - (RTL_FLAG_CHECK3("CONST_OR_PURE_CALL_P", (RTX), CALL_INSN, NOTE, \ - EXPR_LIST)->unchanging) +#define RTL_CONST_OR_PURE_CALL_P(RTX) \ + (RTL_CONST_CALL_P(RTX) || RTL_PURE_CALL_P(RTX)) + +/* 1 if RTX is a call to a looping const or pure function. Built from + ECF_LOOPING_CONST_OR_PURE and DECL_LOOPING_CONST_OR_PURE_P. */ +#define RTL_LOOPING_CONST_OR_PURE_CALL_P(RTX) \ + (RTL_FLAG_CHECK1("CONST_OR_PURE_CALL_P", (RTX), CALL_INSN)->call) /* 1 if RTX is a call_insn for a sibling call. */ #define SIBLING_CALL_P(RTX) \ @@ -1733,7 +1751,6 @@ extern rtx find_reg_equal_equiv_note (const_rtx); extern rtx find_constant_src (const_rtx); extern int find_reg_fusage (const_rtx, enum rtx_code, const_rtx); extern int find_regno_fusage (const_rtx, enum rtx_code, unsigned int); -extern int pure_call_p (const_rtx); extern void remove_note (rtx, const_rtx); extern void remove_reg_equal_equiv_notes (rtx); extern int side_effects_p (const_rtx); |