On Sun, Jul 20, 2025 at 12:39:00AM +0800, Yuao Ma wrote: > On 7/18/2025 11:43 PM, Yuao Ma wrote: > > I noticed that hex(16128084538487209988) evaluates to > > 0xdfd2777000000004, and it looks like the higher bits weren't being > > zeroed out as expected. After I explicitly added pos = > > convert(gfc_charlen_type_node, pos); for type conversion, the test case > > started working perfectly. > > I'm sorry, but just adding a cast doesn't solve the issue. Even if we change > the pointer type, we may not be able to alter the memory layout of the input > parameter. Therefore, when accessing the value with a wide type pointer, we > still may not obtain the desired result...... > > Not sure how to handle this in/out parameter in this case. Maybe the > string_split function in libgfortran should be aware of the integer kind? >
No. It should no be aware of integer kind. You need to deal with this is fortran FE in trans-intrinsics.cc with appropriate convessations of Fortran INTEGERs to C int and back. -- Steve