[Bug fortran/114023] complex part%ref of complex named constant array cannot be used in an initialization expression.

2024-03-13 Thread sgk at troutmask dot apl.washington.edu via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114023

--- Comment #3 from Steve Kargl  ---
On Wed, Mar 13, 2024 at 06:02:58PM +, jvdelisle at gcc dot gnu.org wrote:
> 
> --- Comment #2 from Jerry DeLisle  ---
> Steve, Anuj is interested in digging in on this one. This will be a learning
> experience.
> 

That's fine with.  If Anuj or you have questions or
want me to look at something, just ping me.

[Bug fortran/114023] complex part%ref of complex named constant array cannot be used in an initialization expression.

2024-03-13 Thread jvdelisle at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114023

Jerry DeLisle  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2024-03-13

--- Comment #2 from Jerry DeLisle  ---
Steve, Anuj is interested in digging in on this one. This will be a learning
experience.

[Bug fortran/114023] complex part%ref of complex named constant array cannot be used in an initialization expression.

2024-02-21 Thread kargl at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114023

kargl at gcc dot gnu.org changed:

   What|Removed |Added

   Priority|P3  |P4

--- Comment #1 from kargl at gcc dot gnu.org ---
This one is a bit uglier.  For the testcase,


program foo

   implicit none

   complex(kind=8), parameter :: cmp1(3) = [(1,2),(3,4),(5,6)]

   real :: rr(3) = cmp1%re

   if (any(int(rr) /= [1,3,5])) then
  print '(3(F4.1))', rr
  stop 1
   end if

end

one gets an ICE

% gfcx -o z a.f90 && ./z
a.f90:5:11:

5 | program foo
  |   1
internal compiler error: in gfc_conv_array_initializer, at
fortran/trans-array.cc:6662
0x6eb2cf gfc_conv_array_initializer(tree_node*, gfc_expr*)
../../gccx/gcc/fortran/trans-array.cc:6662

This caused by the insertion of a conversion function __convert_r8_r4()
into the initializer where gfc_conv_array_initializer() is not prepared
to hand it.  Now, if the type declaration of rr is changed to 'real(8)',
then a conversion function is not inserted but wrong code is generated.
I suspect that we need to go code spelunking in resolve.cc.