summaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r--gcc/ipa-pure-const.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 5f19af8c61e..1be8ef1a1c3 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -316,20 +316,15 @@ get_asm_expr_operands (funct_state local, tree stmt)
static void
check_call (funct_state local, tree call_expr)
{
- int flags = call_expr_flags(call_expr);
- tree operand_list = TREE_OPERAND (call_expr, 1);
+ int flags = call_expr_flags (call_expr);
tree operand;
+ call_expr_arg_iterator iter;
tree callee_t = get_callee_fndecl (call_expr);
struct cgraph_node* callee;
enum availability avail = AVAIL_NOT_AVAILABLE;
- for (operand = operand_list;
- operand != NULL_TREE;
- operand = TREE_CHAIN (operand))
- {
- tree argument = TREE_VALUE (operand);
- check_rhs_var (local, argument);
- }
+ FOR_EACH_CALL_EXPR_ARG (operand, iter, call_expr)
+ check_rhs_var (local, operand);
/* The const and pure flags are set by a variety of places in the
compiler (including here). If someone has already set the flags
@@ -452,7 +447,14 @@ scan_function (tree *tp,
case ADDR_EXPR:
check_rhs_var (local, rhs);
break;
- case CALL_EXPR:
+ default:
+ break;
+ }
+ break;
+ case tcc_vl_exp:
+ switch (TREE_CODE (rhs))
+ {
+ case CALL_EXPR:
check_call (local, rhs);
break;
default: