Nvfortran bug(s) with allocatable character objects

This is another spin-off from my master post (which I will link in a minute), the following code leads to a segmentation violation with nvfortran (v23.0)
The reproducer is here:
test_part_spec.f90 (25.5 KB)
with the following backtrace,

Program received signal SIGSEGV, Segmentation fault.
iso_varying_string::len_ () at main_ut.f90:71
71	    if(ALLOCATED(string%chars)) then
(gdb) bt
#0  iso_varying_string::len_ () at main_ut.f90:71
#1  0x000000000040297a in iso_varying_string::op_concat_vs_vs () at main_ut.f90:116
#2  0x000000000040734b in particle_specifiers::prt_spec_to_string () at main_ut.f90:483
#3  0x0000000000408020 in particle_specifiers::prt_spec_list_to_string () at main_ut.f90:529
#4  0x000000000040b2a9 in particle_specifiers::prt_spec_sum_to_string () at main_ut.f90:637
#5  0x0000000000403aca in particle_specifiers::prt_expr_to_string () at main_ut.f90:362
#6  0x000000000041290d in particle_specifiers_uti::particle_specifiers_2 () at main_ut.f90:855
#7  0x0000000000414162 in main_ut () at main_ut.f90:900

while it should give the following output:

* Test output: particle_specifiers_2
*   Purpose: Create and display particle expressions

* Basic expressions

a + b
a, b

* Nested expressions

a + b, c
(a, b), c
a + (b + c)
a + (b, c), d
(a, b) + (c, d)
a + b, c, d + e + f

* Expand as sum

(a, c) + (b, c)
a, b, c
a + b + c
(a, d) + (b, c, d)
(a, b) + (c, d)
(a, c, d) + (a, c, e) + (a, c, f) + (b, c, d) + (b, c, e) + (b, c, f)

* Transform to arrays:
* Atomic specifier

* List
a, b, c

* Sum of atoms

* Sum of lists
a, c, d
a, c, e
a, c, f
b, c, d
b, c, e
b, c, f

Link to master issue:

Thanks Juergen, I filed TPR #33473.

Since you’re starting to send these as individual tests, I’ve stop working through the larger suite. Though I’ll double back once the individual tests have been corrected.