https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93290

            Bug ID: 93290
           Summary: analyzer ICE on isnan()
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

As reported on IRC, this code ICEs the analyzer:

#include <math.h>
int main(void) {
    float foo = 42.;
    if (isnan(foo)) {
        return 1;
    } return 0;
}

during IPA pass: analyzer
foo.c: In function 'main':
foo.c:4:8: internal compiler error: in eval_condition_without_cm, at
analyzer/region-model.cc:5197
    4 |     if (isnan(foo)) {
      |        ^
0x632ab1 region_model::eval_condition_without_cm(svalue_id, tree_code,
svalue_id) const
        ../../gcc-2588197/gcc/analyzer/region-model.cc:5197
0xe2e729 region_model::eval_condition(svalue_id, tree_code, svalue_id) const
        ../../gcc-2588197/gcc/analyzer/region-model.cc:5161
0xe2e729 region_model::add_constraint(tree_node*, tree_code, tree_node*,
region_model_context*)
        ../../gcc-2588197/gcc/analyzer/region-model.cc:5270
0xe20492 program_state::on_edge(exploded_graph&, exploded_node const&,
superedge const*, state_change*)
        ../../gcc-2588197/gcc/analyzer/program-state.cc:727
0xe0f549 exploded_node::on_edge(exploded_graph&, superedge const*,
program_point*, program_state*, state_change*) const
        ../../gcc-2588197/gcc/analyzer/engine.cc:1075
0xe16297 exploded_graph::process_node(exploded_node*)
        ../../gcc-2588197/gcc/analyzer/engine.cc:2500
0xe16822 exploded_graph::process_worklist()
        ../../gcc-2588197/gcc/analyzer/engine.cc:2253
0xe16e69 impl_run_checkers(logger*)
        ../../gcc-2588197/gcc/analyzer/engine.cc:3570
0xe178d3 run_checkers()
        ../../gcc-2588197/gcc/analyzer/engine.cc:3624
0xe0de58 execute
        ../../gcc-2588197/gcc/analyzer/analyzer-pass.cc:84
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Confirmed with ab7c7b46c35ed1be68d4c020a2f20ee96f68b64b.

It's due to unhandled case op == UNORDERED_EXPR in
region_model::eval_condition_without_cm

Reply via email to