On Fri, 04 Mar 2016 17:15:26 +0100, Neven Sajko wrote: > But in p `print *m` just gets me {a11, ..., a1n}. I think it is a bug in GCC. I haven't found it in GCC Bugzilla. I haven't filed it anywhere yet. All these compilers fail the same way: gcc-5.3.1-2.fc23.x86_64 gcc-6.0.0-0.13.fc25.x86_64 gcc (GCC) 6.0.0 20160213 (experimental) clang-3.7.0-4.fc23.x86_64 clang-3.8.0-0.3.fc25.x86_64 The .s diff is for: gcc -o matrix.s matrix.c -Wall -g -S -dA Jan The array variable: (gdb) s f (n=1) at matrix2.c:22 (gdb) ptype m type = int [17][17] (gdb) p m $1 = {{-134241616, 32767, -134252848, 32767, -140382932, 32767, 2224, 0, -134252032, 32767, -136422399, 32767, 2224, 0, -140329216, 32767, -134252112}, {32767, -134252032, 32767, -11384, 32767, -11388, 32767, 1, 0, -136460380, 32767, -140329216, 32767, [...] -10400, 32767, -134225592, 32767, 0, 0, 1, 0, 4195965, 0, 4195328, 0, 0, 0, 4195888}} The bug with the parameter: (gdb) s p (m=0x7fffffffd2a0, n=1) at matrix2.c:9 (gdb) ptype m type = int (*)[17] (gdb) p m $2 = (int (*)[17]) 0x7fffffffd2a0 (gdb) p *m $3 = {-134241616, 32767, -134252848, 32767, -140382932, 32767, 2224, 0, -134252032, 32767, -136422399, 32767, 2224, 0, -140329216, 32767, -134252112} Workaroundable by: (gdb) p *(int[17][17] *)m $4 = {{-134241616, 32767, -134252848, 32767, -140382932, 32767, 2224, 0, -134252032, 32767, -136422399, 32767, 2224, 0, -140329216, 32767, -134252112}, {32767, -134252032, 32767, -11384, 32767, -11388, 32767, 1, 0, -136460380, 32767, -140329216, 32767, [...] -10400, 32767, -134225592, 32767, 0, 0, 1, 0, 4195965, 0, 4195328, 0, 0, 0, 4195888}} After fixed DWARF without the workaround: (gdb) s p (m=0x7fffffffd2a0, n=1) at matrix2.c:9 (gdb) ptype m type = int (*)[17][17] (gdb) p m $1 = (int (*)[17][17]) 0x7fffffffd2a0 (gdb) p *m $2 = {{-134241616, 32767, -134252848, 32767, -140382932, 32767, 2224, 0, -134252032, 32767, -136422399, 32767, 2224, 0, -140329216, 32767, -134252112}, {32767, -134252032, 32767, -11384, 32767, -11388, 32767, 1, 0, -136460380, 32767, -140329216, 32767, [...] -10400, 32767, -134225592, 32767, 0, 0, 1, 0, 4195965, 0, 4195328, 0, 0, 0, 4195888}}