aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/builtins.cc')
-rw-r--r--gcc/builtins.cc41
1 files changed, 20 insertions, 21 deletions
diff --git a/gcc/builtins.cc b/gcc/builtins.cc
index a5f711a..a2ce372 100644
--- a/gcc/builtins.cc
+++ b/gcc/builtins.cc
@@ -1158,12 +1158,18 @@ validate_arglist (const_tree callexpr, ...)
unsigned int idx = TREE_INT_CST_LOW (TREE_VALUE (args)) - 1;
unsigned int idx2
= TREE_INT_CST_LOW (TREE_VALUE (TREE_CHAIN (args))) - 1;
+ unsigned int idx3 = idx2;
+ if (tree chain2 = TREE_CHAIN (TREE_CHAIN (args)))
+ idx3 = TREE_INT_CST_LOW (TREE_VALUE (chain2)) - 1;
if (idx < (unsigned) call_expr_nargs (callexpr)
&& idx2 < (unsigned) call_expr_nargs (callexpr)
+ && idx3 < (unsigned) call_expr_nargs (callexpr)
&& POINTER_TYPE_P (TREE_TYPE (CALL_EXPR_ARG (callexpr, idx)))
&& integer_zerop (CALL_EXPR_ARG (callexpr, idx))
&& INTEGRAL_TYPE_P (TREE_TYPE (CALL_EXPR_ARG (callexpr, idx2)))
- && integer_nonzerop (CALL_EXPR_ARG (callexpr, idx2)))
+ && integer_nonzerop (CALL_EXPR_ARG (callexpr, idx2))
+ && INTEGRAL_TYPE_P (TREE_TYPE (CALL_EXPR_ARG (callexpr, idx3)))
+ && integer_nonzerop (CALL_EXPR_ARG (callexpr, idx3)))
return false;
}
@@ -1640,8 +1646,7 @@ expand_builtin_apply_args (void)
start_sequence ();
temp = expand_builtin_apply_args_1 ();
- rtx_insn *seq = get_insns ();
- end_sequence ();
+ rtx_insn *seq = end_sequence ();
apply_args_value = temp;
@@ -1863,8 +1868,7 @@ expand_builtin_return (rtx result)
push_to_sequence (call_fusage);
emit_use (reg);
- call_fusage = get_insns ();
- end_sequence ();
+ call_fusage = end_sequence ();
size += GET_MODE_SIZE (mode);
}
@@ -2373,8 +2377,7 @@ expand_builtin_mathfn_ternary (tree exp, rtx target, rtx subtarget)
}
/* Output the entire sequence. */
- insns = get_insns ();
- end_sequence ();
+ insns = end_sequence ();
emit_insn (insns);
return result;
@@ -2466,8 +2469,7 @@ expand_builtin_mathfn_3 (tree exp, rtx target, rtx subtarget)
if (result != 0)
{
/* Output the entire sequence. */
- insns = get_insns ();
- end_sequence ();
+ insns = end_sequence ();
emit_insn (insns);
return result;
}
@@ -3164,8 +3166,7 @@ expand_builtin_int_roundingfn (tree exp, rtx target)
if (expand_sfix_optab (target, op0, builtin_optab))
{
/* Output the entire sequence. */
- insns = get_insns ();
- end_sequence ();
+ insns = end_sequence ();
emit_insn (insns);
return target;
}
@@ -3308,8 +3309,7 @@ expand_builtin_int_roundingfn_2 (tree exp, rtx target)
if (expand_sfix_optab (result, op0, builtin_optab))
{
/* Output the entire sequence. */
- insns = get_insns ();
- end_sequence ();
+ insns = end_sequence ();
emit_insn (insns);
return result;
}
@@ -3477,8 +3477,7 @@ expand_builtin_strlen (tree exp, rtx target,
#endif
emit_move_insn (src_reg, pat);
}
- pat = get_insns ();
- end_sequence ();
+ pat = end_sequence ();
if (before_strlen)
emit_insn_after (pat, before_strlen);
@@ -3536,7 +3535,8 @@ expand_builtin_strnlen (tree exp, rtx target, machine_mode target_mode)
wide_int min, max;
int_range_max r;
- get_global_range_query ()->range_of_expr (r, bound);
+ get_range_query (cfun)->range_of_expr (r, bound,
+ currently_expanding_gimple_stmt);
if (r.varying_p () || r.undefined_p ())
return NULL_RTX;
min = r.lower_bound ();
@@ -3611,7 +3611,8 @@ determine_block_size (tree len, rtx len_rtx,
{
int_range_max r;
tree tmin, tmax;
- get_global_range_query ()->range_of_expr (r, len);
+ gimple *cg = currently_expanding_gimple_stmt;
+ get_range_query (cfun)->range_of_expr (r, len, cg);
range_type = get_legacy_range (r, tmin, tmax);
if (range_type != VR_UNDEFINED)
{
@@ -5183,8 +5184,7 @@ expand_builtin_saveregs (void)
/* Do whatever the machine needs done in this case. */
val = targetm.calls.expand_builtin_saveregs ();
- seq = get_insns ();
- end_sequence ();
+ seq = end_sequence ();
saveregs_value = val;
@@ -7624,8 +7624,7 @@ inline_string_cmp (rtx target, tree var_str, const char *const_str,
}
emit_label (ne_label);
- rtx_insn *insns = get_insns ();
- end_sequence ();
+ rtx_insn *insns = end_sequence ();
emit_insn (insns);
return result;