https://bugs.llvm.org/show_bug.cgi?id=38306
Bug ID: 38306
Summary: [GlobalISel][x86_64] 4th argument clobbered by shifts
of 5th arg
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: GlobalISel
Assignee: unassignedb...@nondot.org
Reporter: aivch...@gmail.com
CC: llvm-bugs@lists.llvm.org
int foo(int a, int b, int c, int d, short e)
{
return a + b + c + d + e;
}
int main() {
int a = 1;
int b = 1;
int c = 1;
int d = 1;
int e = 1;
return foo(a, b, c, d, e);
}
> clang test.c -mllvm -global-isel
> ./a.out
> echo $?
20
> clang test.c
> ./a.out
> echo $?
5
global isel generated:
..
movl -8(%rbp), %edi
movl -12(%rbp), %esi
movl -16(%rbp), %edx
movl -20(%rbp), %ecx
movl -24(%rbp), %eax
movl $16, %r8d
movl %r8d, %ecx << Already set up argument is clobbered by this
# kill: def $cl killed $ecx
shll %cl, %eax
movl %r8d, %ecx
# kill: def $cl killed $ecx
sarl %cl, %eax
movl %eax, %r8d
callq foo
..
fast isel generated:
..
movl -8(%rbp), %edi
movl -12(%rbp), %esi
movl -16(%rbp), %edx
movl -20(%rbp), %ecx
movl -24(%rbp), %eax
movw %ax, %r8w
movswl %r8w, %r8d
callq foo
..
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs