Fix correct offset in ipa_get_jf_ancestor_result.

	PR ipa/94232
	* ipa-cp.c (ipa_get_jf_ancestor_result): Use offset in bytes. Previously
	build_ref_for_offset function was used and it transforms off to bytes
	from bits.
parent 8fefa21f
2020-03-20 Martin Liska <mliska@suse.cz>
PR ipa/94232
* ipa-cp.c (ipa_get_jf_ancestor_result): Use offset in bytes. Previously
build_ref_for_offset function was used and it transforms off to bytes
from bits.
2020-03-20 Richard Biener <rguenther@suse.de> 2020-03-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/94266 PR tree-optimization/94266
......
...@@ -1356,9 +1356,10 @@ ipa_get_jf_ancestor_result (struct ipa_jump_func *jfunc, tree input) ...@@ -1356,9 +1356,10 @@ ipa_get_jf_ancestor_result (struct ipa_jump_func *jfunc, tree input)
poly_int64 off = ipa_get_jf_ancestor_offset (jfunc); poly_int64 off = ipa_get_jf_ancestor_offset (jfunc);
if (known_eq (off, 0)) if (known_eq (off, 0))
return input; return input;
poly_int64 byte_offset = exact_div (off, BITS_PER_UNIT);
return build1 (ADDR_EXPR, TREE_TYPE (input), return build1 (ADDR_EXPR, TREE_TYPE (input),
fold_build2 (MEM_REF, TREE_TYPE (TREE_TYPE (input)), fold_build2 (MEM_REF, TREE_TYPE (TREE_TYPE (input)), input,
input, build_int_cst (ptr_type_node, off))); build_int_cst (ptr_type_node, byte_offset)));
} }
else else
return NULL_TREE; return NULL_TREE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment