[PATCH, v2] Fix fortran/PR114024

Harald Anlauf anlauf@gmx.de
Fri Feb 23 21:15:17 GMT 2024


Hi Steve, all,

here's an updated patch with an enhanced testcase that also
checks MOLD= besides SOURCE=.

Regtested on x86_64-pc-linux-gnu.  Is it OK for mainline?

Cheers,
Harald

On 2/22/24 22:32, Harald Anlauf wrote:
> On 2/22/24 22:01, Steve Kargl wrote:
>> BTW, my patch and I suspect your improved patch also
>> fixes 'allocate(x,mold=z%re)'.  Consider,
>>
>>     complex z(3)
>>     real, allocatable :: x(:)
>>     z = 42ha
>>     allocate(x, mold=z%re)
>>     print *, size(x)
>>     end
>>
>> % gfortran13 -o z a.f90
>> a.f90:9:25:
>>
>>      9 |    allocate(x, mold=z%re)
>>        |                         1
>> internal compiler error: in retrieve_last_ref, at
>> fortran/trans-array.cc:6070
>> 0x247d7a679 __libc_start1
>>          /usr/src/lib/libc/csu/libc_start1.c:157
>>
>> % gfcx -o z a.f90 && ./z
>>             3
>>
>
> Nice!  I completely forgot about MOLD...
>
> So the only missing pieces are a really comprehensive testcase
> and successful regtests...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr114024-v2.diff
Type: text/x-patch
Size: 5446 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20240223/3738b775/attachment.bin>


More information about the Fortran mailing list