This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH]: Promote float args on i386 (attn Hurd, Cygwin, DJGPP...)


   Date: Fri, 12 May 2000 10:26:48 -0700
   From: Michael Snyder <msnyder@cygnus.com>

   Mark Kettenis wrote:

   >    Sure.
   >    make check RUNTESTFLAGS=callfuncs.exp
   >    FAIL: gdb.base/callfuncs.exp: p t_float_values(3.14159,-2.3765)
   >    FAIL: gdb.base/callfuncs.exp: p t_float_values(float_val1,float_val2)
   >    FAIL: gdb.base/callfuncs.exp: p t_float_values(3.14159,float_val2)
   >    FAIL: gdb.base/callfuncs.exp: p t_float_values(float_val1,-2.3765)
   >    FAIL: gdb.base/callfuncs.exp: p t_float_values2(3.14159,float_val2)
   > 
   > I don't see those failures on Linux.  

   Really???  I do!  I wonder whether it's a Linux version diff,
   or a compiler diff.  What versions are you using?  Mine are:

   %] msnyder<12>% gcc -v
   Reading specs from
   /usr/progressive/bin/../lib/gcc-lib/i386-pc-linux-gnu/2.9-gnu
   pro-98r1/specs
   gcc version 2.9-gnupro-98r1
   %] msnyder<14>% uname -a
   Linux happy.cygnus.com 2.2.14-5.0smp #1 SMP Tue Mar 7 21:01:40 EST 2000
   i686 unknown

Here are my versions:

delius:~$ gcc -v
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
delius:~$ uname -a
Linux delius.kettenis.local 2.2.14 #4 Thu Feb 3 02:07:27 CET 2000 i586 unknown

It's got nothing to do with the Linux version, and probably everything
with the compiler.  Could you post the assembler output that your compiler
generates for the following fragment:


extern int foo (float f, float g);

void
bar (void)
{
  foo (3.14, 2.72);
}


In my case this yields:


	.file	"foo.c"
	.version	"01.01"
gcc2_compiled.:
.section	.rodata
	.align 4
.LC0:
	.long 0x402e147b
	.align 4
.LC1:
	.long 0x4048f5c3
.text
	.align 4
.globl bar
	.type	 bar,@function
bar:
	pushl %ebp
	movl %esp,%ebp
	subl $8,%esp
	addl $-8,%esp
	flds .LC0
	subl $4,%esp
	fstps (%esp)
	flds .LC1
	subl $4,%esp
	fstps (%esp)
	call foo
	addl $16,%esp
.L2:
	movl %ebp,%esp
	popl %ebp
	ret
.Lfe1:
	.size	 bar,.Lfe1-bar
	.ident	"GCC: (GNU) 2.95.2 19991024 (release)"


The "subl $4,%esp" and "fstps (%esp)" instructions show that the
arguments passed to foo() are both four bytes in size.  So they can't
be doubles.  This is what I'd expect after reading the processor
specific SystemV ABI, which AFAIK is used on Linux.

Mark

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]