diff options
author | David Malcolm <dmalcolm@redhat.com> | 2025-04-28 18:21:20 -0400 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2025-04-28 18:21:20 -0400 |
commit | 5ecea59621c63abdfdb4c91f8c37ab68b40b5b75 (patch) | |
tree | baea2e2aefb3360b9eb625da246ca5a482d0b724 /gcc | |
parent | 0ef00f71969f200589355eb96a393b584340c0cf (diff) | |
download | gcc-5ecea59621c63abdfdb4c91f8c37ab68b40b5b75.zip gcc-5ecea59621c63abdfdb4c91f8c37ab68b40b5b75.tar.gz gcc-5ecea59621c63abdfdb4c91f8c37ab68b40b5b75.tar.bz2 |
analyzer: fail if we see unexpected gimple stmt codes
gcc/analyzer/ChangeLog:
* region-model.cc (region_model::on_stmt_pre): Use internal_error
if we see an unexpected gimple stmt code.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/analyzer/region-model.cc | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/gcc/analyzer/region-model.cc b/gcc/analyzer/region-model.cc index 84b81e9..9583ba6 100644 --- a/gcc/analyzer/region-model.cc +++ b/gcc/analyzer/region-model.cc @@ -1570,13 +1570,15 @@ region_model::on_stmt_pre (const gimple *stmt, { switch (gimple_code (stmt)) { - default: - /* No-op for now. */ - break; - - case GIMPLE_DEBUG: - /* We should have stripped these out when building the supergraph. */ - gcc_unreachable (); + case GIMPLE_COND: + case GIMPLE_EH_DISPATCH: + case GIMPLE_GOTO: + case GIMPLE_LABEL: + case GIMPLE_NOP: + case GIMPLE_PREDICT: + case GIMPLE_RESX: + case GIMPLE_SWITCH: + /* No-ops here. */ break; case GIMPLE_ASSIGN: @@ -1611,6 +1613,13 @@ region_model::on_stmt_pre (const gimple *stmt, on_return (return_, ctxt); } break; + + /* We don't expect to see any other statement kinds in the analyzer. */ + case GIMPLE_DEBUG: // should have stripped these out when building the supergraph + default: + internal_error ("unexpected gimple stmt code: %qs", + gimple_code_name[gimple_code (stmt)]); + break; } } |