[PATCH] floating point with -mintel-syntax

Sam sfryer@computer.org
Tue Nov 13 15:03:00 GMT 2001


The Problem:
$ cat test.c 
int main()
{
	double x = 1.0;
	float y;
	y = x + 2000.0;
	return 0;
}

$ gcc -v -mintel-syntax test.c
Reading specs from
/home/sam/gnu/gcc-3.0.2/usr/lib/gcc-lib/i686-pc-linux-gnu/3.0.2/specs
Configured with: ../gcc-3.0.2/configure
--prefix=/home/sam/gnu/gcc-3.0.2/usr
Thread model: single
gcc version 3.0.2
 /home/sam/gnu/gcc-3.0.2/usr/lib/gcc-lib/i686-pc-linux-gnu/3.0.2/cc1
-lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=0 -D__GNUC_PATCHLEVEL__=2
-D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix
-D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386
-Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__
-D__tune_pentiumpro__ test.c -quiet -dumpbase test.c -mintel-syntax
-version -o /tmp/ccoP6TtG.s
GNU CPP version 3.0.2 (cpplib) (i386 Linux/ELF)
GNU C version 3.0.2 (i686-pc-linux-gnu)
	compiled by GNU C version 3.0.2.
ignoring nonexistent directory
"/home/sam/gnu/gcc-3.0.2/usr/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /home/sam/gnu/gcc-3.0.2/usr/lib/gcc-lib/i686-pc-linux-gnu/3.0.2/include
 /usr/include
End of search list.
 as --traditional-format -V -Qy -o /tmp/ccmyBOFh.o /tmp/ccoP6TtG.s
GNU assembler version 2.11.90.0.8 (i386-redhat-linux) using BFD version
2.11.90.0.8
/tmp/ccoP6TtG.s: Assembler messages:
/tmp/ccoP6TtG.s:18: Error: no such instruction: `fldl QWORD PTR[%ebp-8]'
/tmp/ccoP6TtG.s:19: Error: no such instruction: `faddl QWORD PTR .LC0'
/tmp/ccoP6TtG.s:20: Error: no such instruction: `fstps DWORD
PTR[%ebp-12]'

In this case, the assembler is right.  In Intel-style syntax, the size
suffixes shouldn't be inserted.  Included is a patch for 3.0.2.  There's
also problems with libstdc++ (which uses inline assembly in the
headers), but although I have a workaround, I don't have a clean patch
for that yet.

Sam.


--- i386.c	Fri Sep 14 13:11:12 2001
+++ /home/sam/gnu/gcc-3.0.2/gcc-3.0.2/gcc/config/i386/i386.c	Wed Nov  7
23:31:28 2001
@@ -3494,7 +3494,7 @@
 	  /* 387 opcodes don't get size suffixes if the operands are
 	     registers.  */
 
-	  if (STACK_REG_P (x))
+	  if ((STACK_REG_P (x)) || (ASSEMBLER_DIALECT == 1))
 	    return;
 
 	  /* this is the size of op from size of operand */



More information about the Gcc-patches mailing list