ipa_value_from_jfunc (class ipa_node_params *info, struct ipa_jump_func *jfunc,
tree parm_type)
{
+ if (!parm_type)
+ return NULL_TREE;
if (jfunc->type == IPA_JF_CONST)
- return ipa_get_jf_constant (jfunc);
+ return ipacp_value_safe_for_type (parm_type, ipa_get_jf_constant (jfunc));
else if (jfunc->type == IPA_JF_PASS_THROUGH
|| jfunc->type == IPA_JF_ANCESTOR)
{
if (jfunc->type == IPA_JF_PASS_THROUGH)
{
- if (!parm_type)
- return NULL_TREE;
enum tree_code opcode = ipa_get_jf_pass_through_operation (jfunc);
tree op2 = ipa_get_jf_pass_through_operand (jfunc);
tree op_type
return ipacp_value_safe_for_type (parm_type, cstval);
}
else
- return ipa_get_jf_ancestor_result (jfunc, input);
+ return ipacp_value_safe_for_type (parm_type,
+ ipa_get_jf_ancestor_result (jfunc,
+ input));
}
else
return NULL_TREE;
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -std=gnu89" } */
+
+double cos(double);
+void sub(p1, p2, p3, p4, p5, p6) float p1, p2, p3, *p4, p5, p6;
+{
+ float ar2 = cos(*p4);
+ if (p2)
+ ar2 = 0.0;
+ for (;;)
+ *p4 += ar2;
+}
+void main() { sub(1.0, 2.0); }