https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87937

--- Comment #11 from Tomáš Trnka <trnka at scm dot com> ---
(In reply to Paul Thomas from comment #10)
> As I read that, or its equivalent in earlier standards, reallocation on
> assignment cannot occur for the likes of the testcase in comments #5 and #8.

Good catch, I kinda suspected this may be the case. I just pulled the testcase
from pr85954, assuming that it used to work at some point.

> I guess that we have to think of a suitable runtime check to flag this up.
> How do the other brands behave?

ifort 18.0.3 accepts the character(:) testcase in comment #5, but the
assignment/allocation never happens, so that "x" stays unallocated, zero size,
no segfault. However, the integer testcase in comment #8 reliably segfaults
just like with gfortran.

> However, I think that the original testcase is valid and that the allocation
> on assignment should occur. I will take this but it joins an ever increasing
> number of bugs that I have on my TODO list.

I see. If I understand the situation correctly, the fix for pr85954 fixed an
ICE on invalid Fortran code (causing a segfault at runtime instead), but also
broke the perfectly valid code here. Then perhaps reverting the fix for pr85954
would be a sensible stop-gap for now?

I'm sorry for sounding a bit impatient, but this PR currently makes our
(commercial) software unusable with GCC, so if it makes it into 8.3 and then
into Linux distro updates, we're going to have some quite unhappy users. Right
now, we only caught it on Fedora, which tracks the gcc-8 branch.

Reply via email to