if (DECL_EXTERNAL (m_decl))
return NULL;
+ if (empty_p ())
+ return NULL;
+
/* Implicit initialization to zero; use a compound_svalue for it.
Doing so requires that we have a concrete binding for this region,
which can fail if we have a region with unknown size
return false;
bit_offset_t start_bit_offset = min_offset.get_bit_offset ();
store_manager *smgr = mgr->get_store_manager ();
+ if (max_element->empty_p ())
+ return false;
const binding_key *max_element_key = binding_key::make (smgr, max_element);
if (max_element_key->symbolic_p ())
return false;
else
{
const svalue *sval = get_svalue_for_ctor_val (val, mgr);
+ if (child_reg->empty_p ())
+ return false;
const binding_key *k
= binding_key::make (mgr->get_store_manager (), child_reg);
/* Handle the case where we have an unknown size for child_reg
return;
}
+ if (reg->empty_p ())
+ return;
const binding_key *binding = binding_key::make (mgr, reg);
bind_key (binding, sval);
}
binding_cluster::purge_region (store_manager *mgr, const region *reg)
{
gcc_assert (reg->get_kind () == RK_DECL);
+ if (reg->empty_p ())
+ return;
const binding_key *binding
= binding_key::make (mgr, const_cast<region *> (reg));
m_map.remove (binding);
if (reg_offset.symbolic_p ())
return NULL;
+ if (reg->empty_p ())
+ return NULL;
+
region_model_manager *sval_mgr = mgr->get_svalue_manager ();
/* We will a build the result map in two parts:
if (m_map.elements () != 1)
return NULL;
+ if (m_base_region->empty_p ())
+ return NULL;
+
const binding_key *key = binding_key::make (mgr, m_base_region);
return get_any_value (key);
}
--- /dev/null
+! { dg-do compile }
+! { dg-additional-options "-fcheck=bounds -Wno-analyzer-malloc-leak" }
+! Copy of gfortran.dg/bounds_check_23.f90
+! as a regression test for ICE with -fanalyzer (PR analyzer/108065)
+
+program test
+ implicit none
+ call sub('Lorem ipsum')
+contains
+ subroutine sub( text )
+ character(len=*), intent(in) :: text
+ character(len=1), allocatable :: c(:)
+ integer :: i
+ c = [ ( text(i:i), i = 1, len(text) ) ]
+ if (c(1) /= 'L') stop 1
+ end subroutine sub
+end program test