Strange output code

Per Lundberg plundis@chaosdev.org
Sat Oct 2 09:10:00 GMT 1999


The following is a code sample of code generated by gcc version 2.95.2
19990906 (prerelease):

 800072b:       9a 00 00 00 00 50 01    lcall  $0x150,$0x0
 8000732:       89 c0                   mov    %eax,%eax
 8000734:       89 c2                   mov    %eax,%edx
 8000736:       89 51 fc                mov    %edx,0xfffffffc(%ecx)
 8000739:       8b 51 fc                mov    0xfffffffc(%ecx),%edx
 800073c:       8b 51 fc                mov    0xfffffffc(%ecx),%edx
 800073f:       89 d1                   mov    %edx,%ecx

Not very effective, to say the least. :-)

The command line looks like this:

gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I. -I../../include    -O3 \
-fomit-frame-pointer -fno-builtin -Wall -Werror -c tornado.c

And the code:

pid_type vga_pid = syscall_process_get_pid_by_name ("vga");

The function syscall_process_get_pid_by_name looks like this:

pid_type extern inline volatile syscall_process_get_pid_by_name (byte
*name)
{
  volatile register dword r;
  asm volatile ("pushl %0" : : "dN" (name));
  asm volatile ("lcall %0, $0" : : "n" (SYSCALL_PROCESS_NAME_GET_PID << 
3));
  asm volatile ("movl %%eax, %0": "=a" (r) :);
  return r;
}

What am I doing wrong here? (I'm not subscribed to this list, so please
reply by private mail).



More information about the Gcc-bugs mailing list