[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/4587] New: Sparc fcmps instruction - extra operand causes SEGFA

From: j dot auricchio at gmail dot com
Subject: [Bug gas/4587] New: Sparc fcmps instruction - extra operand causes SEGFAULT
Date: 3 Jun 2007 06:18:49 -0000

Working on a Compilers project (http://www.cs.ucsd.edu/~ricko/CSE131B/). We're 
compiling Oberon to 
Sparc assembly.
I had a bug in my code generator that revealed a crasher in gas.

If you pass three operands to the Sparc floating-point instruction fcmps 
(floating-point single-
precision compare), gas segfaults. fcmps is only supposed to take two operands. 
This should cause an 
illegal operand error, but instead it segfaults. I haven't tested to see if any 
other floating-point 
instructions are affected.

The server we test our code on is running an older version of gas. Perhaps this 
has been fixed. If so, 
sorry for bugging you.

gas -v: GNU assembler version 2.14 (sparc-sun-solaris2.8) using BFD version 
2.14 20030612

uname -a: SunOS ieng9.ucsd.edu 5.10 Generic_125100-07 sun4u sparc 

.section .data
.align 4
zero: .single 0.0
.section .text
.align 4
.global main
    save %sp, -96, %sp

    ! Zero-out the first FP register
    set zero, %l0
    ld [%l0], %f0

    ! Compare it to itself
    ! The third reg (%f0) will cause a segfault in as
    ! fcmps only takes two regs... this should be illegal operand error
    fcmps %f0, %f0, %f0

    ! Return 0
    restore %g0, %g0, %o0

Backtrace (from gdb... WOW we have debugging symbols on???)
(gdb) where
#0  0xff2b0e50 in strlen () from /lib/libc.so.1
#1  0xff316460 in _ndoprnt () from /lib/libc.so.1
#2  0xff318be8 in vsprintf () from /lib/libc.so.1
#3  0x2bfc0 in as_bad (format=0x7fffffff <Address 0x7fffffff out of bounds>)
    at /src/gnu/gcc/binutils-2.14/gas/messages.c:340
#4  0x3beb0 in sparc_ip (str=0xfe4dc "fcmps", pinsn=0xffbff89c)
    at /src/gnu/gcc/binutils-2.14/gas/config/tc-sparc.c:2670
#5  0x3ba74 in md_assemble (str=0xfe4dc "fcmps")
    at /src/gnu/gcc/binutils-2.14/gas/config/tc-sparc.c:1303

Hmm.... it looks like it was trying to print an error message, but failed.

           Summary: Sparc fcmps instruction - extra operand causes SEGFAULT
           Product: binutils
           Version: 2.14
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: j dot auricchio at gmail dot com
                CC: bug-binutils at gnu dot org
  GCC host triplet: sparc-sun-solaris2.8


------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]