diff options
author | Richard Biener <rguenther@suse.de> | 2022-04-13 15:43:01 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2022-05-02 14:58:51 +0200 |
commit | 1cb220498e1f59021dab36c39c5d726e9f070c6a (patch) | |
tree | 15d7e4a2f8e31419626fc52f6c3dfbced17d5f02 /gcc | |
parent | 41e3db05d697405256b6002d8432955a93d249f1 (diff) | |
download | gcc-1cb220498e1f59021dab36c39c5d726e9f070c6a.zip gcc-1cb220498e1f59021dab36c39c5d726e9f070c6a.tar.gz gcc-1cb220498e1f59021dab36c39c5d726e9f070c6a.tar.bz2 |
Assume a call is expensive when it mismatches
This makes sure to not consider calls to builtin decls with
mismatching arguments as inexpensive.
2022-04-13 Richard Biener <rguenther@suse.de>
* tree-scalar-evolution.cc (expression_expensive_p):
Never consider mismatched calls as cheap.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/tree-scalar-evolution.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-scalar-evolution.cc b/gcc/tree-scalar-evolution.cc index 4415726..b53d7aa 100644 --- a/gcc/tree-scalar-evolution.cc +++ b/gcc/tree-scalar-evolution.cc @@ -3420,12 +3420,15 @@ expression_expensive_p (tree expr, hash_map<tree, uint64_t> &cache, break; return true; } + break; + default: + if (cfn == CFN_LAST + || !is_inexpensive_builtin (get_callee_fndecl (expr))) + return true; break; } - if (!is_inexpensive_builtin (get_callee_fndecl (expr))) - return true; FOR_EACH_CALL_EXPR_ARG (arg, iter, expr) if (expression_expensive_p (arg, cache, op_cost)) return true; |