https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92305

--- Comment #16 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Recap (see comment 11): Callee's arguments are
 (aa, bb, c_aptr, c_bptr, aptr, bptr, _aa, _bb, _c_aptr, _c_bptr)
i.e. 2 real(kind=4)/float variables, 4 pointers and 4 Booleans.

And the call is
 (aa.1_1, bb.2_2, c_aptr_4(D), c_bptr_5(D), &aptr, &bptr, 1, 1, 1, 1)
According to the debugger and run-time print debugging, the last two Booleans,
i.e. _c_aptr and _c_bptr, are mishandled.

Andrew Jenner did some early analysis for me. (Thanks!) See comment 11 for the
assembler code referred below.

On the caller side, the Booleans (tmp121 and tmp122) are stored at 40(1) and
32(1), respectively.

In the callee, the frame size is 48 bytes (stdu 1,-48(1)). So after the update
we would expect the booleans to be at 88(1) and 80(1).

But the callee appears to be loading them from 144(31) and 152(31); (r31 is
copied from r1).

And the compiler is using 80(31) and 88(31) to stash aa and bb
        stfd 1,80(31)    # aa, aa
        stfd 2,88(31)    # bb, bb

Remains the question why the backend is confused where those parameters live on
the stack.

Reply via email to