X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fipa-prop.c;h=70622e5e4355ba1007b20947e98624d725a42159;hb=329d3a2b57fdd28d824d71b84d357cbd3aa2b890;hp=73203a386b778972e6f296dc623cc5693e4d03d6;hpb=b1471ee0deedd79e8e83cc12dc4851fef9631d16;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 73203a386b7..70622e5e435 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -2465,7 +2465,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, base_offset + adj->offset / BITS_PER_UNIT); off = int_const_binop (PLUS_EXPR, TREE_OPERAND (base, 1), - off, 0); + off); base = TREE_OPERAND (base, 0); } else @@ -2888,7 +2888,8 @@ ipa_prop_write_jump_functions (cgraph_node_set set) for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi)) { node = csi_node (csi); - if (node->analyzed && IPA_NODE_REF (node) != NULL) + if (cgraph_function_with_gimple_body_p (node) + && IPA_NODE_REF (node) != NULL) count++; } @@ -2898,7 +2899,8 @@ ipa_prop_write_jump_functions (cgraph_node_set set) for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi)) { node = csi_node (csi); - if (node->analyzed && IPA_NODE_REF (node) != NULL) + if (cgraph_function_with_gimple_body_p (node) + && IPA_NODE_REF (node) != NULL) ipa_write_node_info (ob, node); } lto_output_1_stream (ob->main_stream, 0); @@ -3000,6 +3002,7 @@ ipa_update_after_lto_read (void) /* Given the jump function JFUNC, compute the lattice LAT that describes the value coming down the callsite. INFO describes the caller node so that pass-through jump functions can be evaluated. */ + void ipa_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat, struct ipa_jump_func *jfunc) @@ -3059,3 +3062,19 @@ ipa_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat, else lat->type = IPA_BOTTOM; } + +/* Determine whether JFUNC evaluates to a constant and if so, return it. + Otherwise return NULL. INFO describes the caller node so that pass-through + jump functions can be evaluated. */ + +tree +ipa_cst_from_jfunc (struct ipa_node_params *info, struct ipa_jump_func *jfunc) +{ + struct ipcp_lattice lat; + + ipa_lattice_from_jfunc (info, &lat, jfunc); + if (lat.type == IPA_CONST_VALUE) + return lat.constant; + else + return NULL_TREE; +}