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

            Bug ID: 93993
           Summary: ICE in make_region_for_unexpected_tree_code, at
                    analyzer/region-model.cc:4786
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

gfortran-10.0.1-alpha20200301 snapshot
(g:151bf47e78f5d919f6cc591d11cc1f6aff61078f) ICEs when compiling the following
testcase w/ -O1 -fanalyzer:

module np
  implicit none
  integer, parameter :: za = selected_real_kind(15, 307)
end module np

module gg
  use np

  type et(real_kind)
    integer, kind :: real_kind
  end type et

contains

  function hv (tm) result(ce)
    type (et(real_kind=za)), allocatable, target :: tm
    type (et(real_kind=za)), pointer :: ce

    allocate (tm)
    ce => tm
  end function hv

end module gg

program a5
  use np
  use gg
  implicit none
  type (et(real_kind=za)), allocatable :: qb
  type (et(real_kind=za)), pointer :: vt

  vt => hv (qb)
end program a5

% powerpc-e300c3-linux-gnu-gfortran-10.0.1 -O1 -fanalyzer -w -c ineya7os.f90
during IPA pass: analyzer
ineya7os.f90:21:0:

   21 |   end function hv
      | 
internal compiler error: in make_region_for_unexpected_tree_code, at
analyzer/region-model.cc:4786
0x74c35f
ana::region_model::make_region_for_unexpected_tree_code(ana::region_model_context*,
tree_node*, dump_location_t const&)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/region-model.cc:4786
0x74c35f
ana::region_model::make_region_for_unexpected_tree_code(ana::region_model_context*,
tree_node*, dump_location_t const&)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/region-model.cc:4782
0x1271af6 ana::region_model::get_lvalue_1(ana::path_var,
ana::region_model_context*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/region-model.cc:4650
0x1272043 ana::region_model::get_lvalue(ana::path_var,
ana::region_model_context*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/region-model.cc:4811
0x17fb7d5 ana::state_change_event::get_lvalue(tree_node*) const
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/checker-path.h:206
0x17fb7d5 ana::diagnostic_manager::prune_for_sm_diagnostic(ana::checker_path*,
ana::state_machine const*, tree_node*, unsigned int) const
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/diagnostic-manager.cc:1161
0x17fba62 ana::diagnostic_manager::prune_path(ana::checker_path*,
ana::state_machine const*, tree_node*, unsigned int) const
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/diagnostic-manager.cc:1056
0x17fbd5c ana::diagnostic_manager::emit_saved_diagnostic(ana::exploded_graph
const&, ana::saved_diagnostic const&, ana::exploded_path const&, gimple const*,
int)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/diagnostic-manager.cc:520
0x17fc86a ana::dedupe_winners::emit_best(ana::diagnostic_manager*,
ana::exploded_graph const&)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/diagnostic-manager.cc:446
0x17fc86a ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph
const&)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/diagnostic-manager.cc:489
0x1253aaf ana::impl_run_checkers(ana::logger*)
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/engine.cc:3807
0x12548c1 ana::run_checkers()
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/engine.cc:3850
0x1248518 execute
       
/var/tmp/portage/cross-powerpc-e300c3-linux-gnu/gcc-10.0.1_alpha20200301/work/gcc-10-20200301/gcc/analyzer/analyzer-pass.cc:84

(While my target here is powerpc, the ICE is not target-specific.)

Reply via email to