analyzer: fix ICE with fortran constant arguments (PR 93405)
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 5 Feb 2020 21:48:53 +0000 (16:48 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Mon, 10 Feb 2020 21:23:59 +0000 (16:23 -0500)
commit41a9e940c7014f117738a9a59b31833047a1083d
treeeaad923c5d678f90dfedabfabc76fb407074302e
parente9fb7579cbb9fa7adea13e7ee34dfd44fe19ad90
analyzer: fix ICE with fortran constant arguments (PR 93405)

PR analyzer/93405 reports an ICE with -fanalyzer when passing
a constant "by reference" in gfortran.

The issue is that the constant is passed as an ADDR_EXPR
of a CONST_DECL, and region_model::get_lvalue_1 doesn't
know how to handle CONST_DECL.

This patch implements it for CONST_DECL by providing
a placeholder region, holding the CONST_DECL's value,
fixing the ICE.

gcc/analyzer/ChangeLog:
PR analyzer/93405
* region-model.cc (region_model::get_lvalue_1): Implement
CONST_DECL.

gcc/testsuite/ChangeLog:
PR analyzer/93405
* gfortran.dg/analyzer/pr93405.f90: New test.
gcc/analyzer/ChangeLog
gcc/analyzer/region-model.cc
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/analyzer/pr93405.f90 [new file with mode: 0644]