For a local variable such as
character(len=:), allocatable :: str2
the code for generating the initial nullifying (and the final deallocation)
happens at the end of procedures, thus input_location points to the last line.
This leads to strange locations if one does debugging. Before the patch, one has:
character(kind=1)[1:3] * str2;
[test.f90 : 6] try
{
[test.f90 : 6] str2 = 0B; /* This is the break point. */
[test.f90 : 4] [test.f90 : 4] __builtin_memcpy /* str1 = '1234'. */
With the patch:
[hj4.f90 : 6] try
{
[hj4.f90 : 3] str2 = 0B;
[hj4.f90 : 4] [hj4.f90 : 4] __builtin_memcpy ...
Build and currently regtesting on x86-64-linux.
OK for the trunk?
Tobias
PS: I have not tested all combinations; I think there is room for improvement
and I hope that I have not introduced location regressions.