Skip to content

clang 18 fails tail call #114121

@hjl-tools

Description

@hjl-tools
[hjl@gnu-tgl-3 pr14907]$ cat s.c
extern int baz (long c1);

int
foo (short c1)
{
  return baz (c1);
}
[hjl@gnu-tgl-3 pr14907]$ clang -S -O2 s.c
[hjl@gnu-tgl-3 pr14907]$ cat s.s
	.text
	.file	"s.c"
	.globl	foo                             # -- Begin function foo
	.p2align	4, 0x90
	.type	foo,@function
foo:                                    # @foo
	.cfi_startproc
# %bb.0:
	movslq	%edi, %rdi
	jmp	baz                             # TAILCALL
.Lfunc_end0:
	.size	foo, .Lfunc_end0-foo
	.cfi_endproc
                                        # -- End function
	.ident	"clang version 18.1.8 (Fedora 18.1.8-1.fc40)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
[hjl@gnu-tgl-3 pr14907]$ 
``

"movslq	%edi, %rdi" should be "movswq	%di, %rdi"

Metadata

Metadata

Assignees

No one assigned

    Labels

    clangClang issues not falling into any other category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions