On 05/29/2015 02:42 PM, Aldy Hernandez wrote:
unsigned int i=555;
int main()
{
unsigned int array[i];
...
}
For the VLA, I'd like to check if we have an array type with a missing
DW_AT_{upper,lower}_bound late in the game, and fill it in.
During early dwarf we only have an uninitialized gimple register
representing the bound
Ah, I see, from gimplify_type_sizes.
and loc_list_from_tree() cannot find the RTL
with the final bound location. Thus, we end up with a missing bound,
which I propose to fill in late dwarf.
OK, that makes sense. I wonder if we should emit debug info for the
gimple register; that would allow us to fill in the bound during early
dwarf.
Obviously I was doing some nonsense with TYPE_SIZE != INTEGER_CST, when
in reality I should probably check that TREE_CODE (type) == ARRAY_TYPE
and that we are missing the bound late (by looking for DW_AT_*_bound in
the cached DIE).
But this sounds reasonable.
Jason