target/5760: -masm=intel [a.k.a. -mintel-syntax] generates incorrect x87 code

kelleycook@comcast.net kelleycook@comcast.net
Sat Feb 23 12:23:00 GMT 2002


>Number:         5760
>Category:       target
>Synopsis:       -masm=intel [a.k.a. -mintel-syntax] generates incorrect x87 code
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 23 09:56:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     kelleycook@comcast.net
>Release:        gcc version 3.1 20020222 (experimental)
>Organization:
>Environment:
Any Intel x86 compatible platform with x87 support.
>Description:
When using -mintel-syntax (changed to -masm=intel for 3.1).  It generates x87 opcodes that are illegal by appending the att-style length suffix.  Some older versions of as included with GNU binutils accepted these illegal opcodes, but the current released and CVS versions of will not.

For example on one of my programs if outputs this:

rate.s.orig: Assembler messages:
rate.s.orig:1455: Error: no such instruction: `fldl QWORD PTR LC20'
rate.s.orig:1461: Error: no such instruction: `fstpl QWORD PTR[ebp-32]'
rate.s.orig:1472: Error: no such instruction: `fldl QWORD PTR[ebp-32]'
rate.s.orig:1475: Error: no such instruction: `fstpl QWORD PTR[ebp-32]'
...
>How-To-Repeat:
On an Intel platform with binutils 2.11.x run GCC's 
make check RUNTESTFLAGS="--tool_opts 'masm=intel'"

Illegal opcodes will occur during most of the floating point tests.
>Fix:
A one liner to i386.c  that I'll append to this in after a bootstrap with BOOT_CFLAGS="-masm=intel" completes.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list