------- Additional Comments From Thomas dot Koenig at online dot de 2005-01-04 14:54 ------- I did some debugging on my testcase, and I think I've found some of the things wrong with it:
$ gdb ./a.out GNU gdb Red Hat Linux (6.1post-1.20040607.52rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "ia64-redhat-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1". (gdb) b _gfortran_msum_r4 Function "_gfortran_msum_r4" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (_gfortran_msum_r4) pending. (gdb) r Starting program: /home/zfkts/Krempel/a.out Breakpoint 2 at 0x200000000008ce82: file ../../../gcc-4.0-20050102/libgfortran/generated/sum_r4.c, line 159. Pending breakpoint "_gfortran_msum_r4" resolved Breakpoint 2, *_gfortran_msum_r4 (retarray=0x60000fffffff9aa8, array=0x60000fffffff9b38, pdim=0x6000000000001ca0, mask=0x60000fffffff9af0) at ../../../gcc-4.0-20050102/libgfortran/generated/sum_r4.c:176 176 rank = GFC_DESCRIPTOR_RANK (array) - 1; (gdb) p *array $1 = {data = 0x60000fffffff9a70, base = 0x0, dtype = 282, dim = {{stride = 1, lbound = 1, ubound = 2}, {stride = 2, lbound = 1, ubound = 2}, { stride = 9771720475859222528, lbound = 2, ubound = 2}, {stride = 1, lbound = 2, ubound = 2}, {stride = 2, lbound = 1, ubound = 2}, { stride = 0, lbound = 6917546619827100608, ubound = 2305843009217774080}, {stride = 0, lbound = 2674341018862399, ubound = 0}}} This looks ok. rank is 2: (gdb) p array->dtype & 0x7 $2 = 2 and the strides are looking good. Retarray looks less good: (gdb) p retarray $3 = (gfc_array_r4 *) 0x60000fffffff9aa8 (gdb) p *retarray $4 = {data = 0x0, base = 0x0, dtype = 281, dim = {{stride = 0, lbound = 0, ubound = 1}, {stride = 2, lbound = 0, ubound = 1}, { stride = 6917546619827100304, lbound = 0, ubound = 274}, {stride = 0, lbound = 0, ubound = 1}, {stride = 2, lbound = 0, ubound = 1}, { stride = 6917546619827100272, lbound = 0, ubound = 282}, {stride = 1, lbound = 1, ubound = 2}}} (gdb) p retarray->data $5 = (GFC_REAL_4 *) 0x0 In other words, the values are supposed to be written through the null pointer, which is bad news, so retarray isn't set up correctly here. Thomas -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19106