https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93405
Bug ID: 93405 Summary: Passing constant arguments to subroutines in Fortran ... and the analyzer. Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: analyzer Assignee: dmalcolm at gcc dot gnu.org Reporter: toon at moene dot org Target Milestone: --- I think the analyzer has a problem in the way constant arguments are passed "by reference" in Fortran: $ cat main1.f real a(10), b(10), c(10) a = 0. b = 1. call sum(a, b, c, 10) print *, c(5) end subroutine sum(a, b, c, n) integer i, n real a(n), b(n), c(n) do i = 1, n c(i) = a(i) + b(i) enddo end $ ~/compilers/install/bin/gfortran -fanalyzer -S main1.f during IPA pass: analyzer main1.f:4:0: 4 | call sum(a, b, c, 10) | internal compiler error: in get_lvalue_1, at analyzer/region-model.cc:4617 0x782863 ana::region_model::get_lvalue_1(ana::path_var, ana::region_model_context*) /home/toon/compilers/gcc/gcc/analyzer/region-model.cc:4617 0x11bc8c3 ana::region_model::get_lvalue(ana::path_var, ana::region_model_context*) /home/toon/compilers/gcc/gcc/analyzer/region-model.cc:4720 0x11bdcdc ana::region_model::get_rvalue_1(ana::path_var, ana::region_model_context*) /home/toon/compilers/gcc/gcc/analyzer/region-model.cc:4763 0x11bde53 ana::region_model::get_rvalue(ana::path_var, ana::region_model_context*) /home/toon/compilers/gcc/gcc/analyzer/region-model.cc:4800 0x11bf209 ana::region_model::update_for_call_superedge(ana::call_superedge const&, ana::region_model_context*) /home/toon/compilers/gcc/gcc/analyzer/region-model.cc:5658 0x11bf2f7 ana::region_model::maybe_update_for_edge(ana::superedge const&, gimple const*, ana::region_model_context*) /home/toon/compilers/gcc/gcc/analyzer/region-model.cc:5599 0x11aaba2 ana::program_state::on_edge(ana::exploded_graph&, ana::exploded_node const&, ana::superedge const*, ana::state_change*) /home/toon/compilers/gcc/gcc/analyzer/program-state.cc:734 0x1198349 ana::exploded_node::on_edge(ana::exploded_graph&, ana::superedge const*, ana::program_point*, ana::program_state*, ana::state_change*) const /home/toon/compilers/gcc/gcc/analyzer/engine.cc:1081 0x119f1ad ana::exploded_graph::process_node(ana::exploded_node*) /home/toon/compilers/gcc/gcc/analyzer/engine.cc:2506 0x119f7b2 ana::exploded_graph::process_worklist() /home/toon/compilers/gcc/gcc/analyzer/engine.cc:2259 0x119fe19 ana::impl_run_checkers(ana::logger*) /home/toon/compilers/gcc/gcc/analyzer/engine.cc:3580 0x11a0883 ana::run_checkers() /home/toon/compilers/gcc/gcc/analyzer/engine.cc:3634 0x11967d8 execute /home/toon/compilers/gcc/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.