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

--- Comment #36 from David Edelsohn <dje at gcc dot gnu.org> ---
I don't know enough FORTRAN90 to instruct the compiler to use an external
function as if it were native.

EXTERNAL :: MYFUNC

changes the calling convention.

But if I manually change the assembly code so that "val" calls a C function a
print the values

#include <stdio.h>

void
val_0 (int x, int y)
{
  printf ("char(0x%x = %d) = %c 0 0 %c (LEN = %d)\n",
    x, x, (char) (x>>24), (char) (x), y);
}

it produces the following output (32 bit):

char(0x41000000 = 1090519040) = A 0 0  (LEN = 1)
char(0x41 = 65) =  0 0 A (LEN = 1)
char(0x41 = 65) =  0 0 A (LEN = 1)

for 

  call val   ("A")
  call val   (c)
  call val   (char(a))

to demonstrate exactly what I see on big endian POWER.

Reply via email to