diff options
author | David Malcolm <dmalcolm@redhat.com> | 2020-09-07 17:16:37 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2020-09-08 10:49:05 -0400 |
commit | 47997a32e63b77ec88a7131a5d540f108c698661 (patch) | |
tree | dc2f7b610852d37f05a40a0a8dbd2efb3de58487 | |
parent | 19b0fed7c2d3663f0f144ca8557b6af29bafa4e3 (diff) | |
download | gcc-47997a32e63b77ec88a7131a5d540f108c698661.zip gcc-47997a32e63b77ec88a7131a5d540f108c698661.tar.gz gcc-47997a32e63b77ec88a7131a5d540f108c698661.tar.bz2 |
analyzer: fix ICE on machine-specific builtins [PR96962]
In g:ee7bfbe5eb70a23bbf3a2cedfdcbd2ea1a20c3f2 I added a
switch (DECL_UNCHECKED_FUNCTION_CODE (callee_fndecl))
to region_model::on_call_pre guarded by
fndecl_built_in_p (callee_fndecl).
I meant to handle only normal built-ins, whereas this
single-argument overload of fndecl_built_in_p returns true for any
kind of built-in.
PR analyzer/96962 reports a case where this matches for a
machine-specific builtin, leading to an ICE. Fixed thusly.
gcc/analyzer/ChangeLog:
PR analyzer/96962
* region-model.cc (region_model::on_call_pre): Fix guard on switch
on built-ins to only consider BUILT_IN_NORMAL, rather than other
kinds of build-ins.
-rw-r--r-- | gcc/analyzer/region-model.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index a7bc481..e6a9d3c 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -653,7 +653,7 @@ region_model::on_call_pre (const gcall *call, region_model_context *ctxt) Having them split out into separate functions makes it easier to put breakpoints on the handling of specific functions. */ - if (fndecl_built_in_p (callee_fndecl) + if (fndecl_built_in_p (callee_fndecl, BUILT_IN_NORMAL) && gimple_builtin_call_types_compatible_p (call, callee_fndecl)) switch (DECL_UNCHECKED_FUNCTION_CODE (callee_fndecl)) { |