[LLVMbugs] [Bug 3779] New: sign extension bahaviour is different from gcc

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Mar 10 16:25:40 PDT 2009


http://llvm.org/bugs/show_bug.cgi?id=3779

           Summary: sign extension bahaviour is different from gcc
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: llc
        AssignedTo: rafael.espindola at gmail.com
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Compiling
----------------------
short x;

void g(int);
short h(void);

short f(void) {
  g(h());
  return x;
}
--------------------

with gcc produces

-----------------------------
      call    h
      movswl  %ax,%edi
      call    g
      movw    x(%rip), %ax
----------------------------

Note that only the caller does sign extension

with llvm we have
-------------------------------
        call    h
        movswl  %ax, %edi
        call    g
        movswl  x, %eax
------------------------------

Note that both caller and callee do sign extension.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list