Skip to content
Snippets Groups Projects
Commit 5f345581 authored by H.J. Lu's avatar H.J. Lu
Browse files

force-indirect-call-2.c: Allow indirect branch via GOT


r15-1619-g3b9b8d6cfdf593 changed the codegen from

f2:
	.cfi_startproc
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movq	f1@GOTPCREL(%rip), %rbx
	call	*%rbx
	leaq	f3(%rip), %rax
	call	*%rax
	movq	%rbx, %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	jmp	*%rax
	.cfi_endproc

to

f2:
	.cfi_startproc
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	*f1@GOTPCREL(%rip)
	leaq	f3(%rip), %rax
	call	*%rax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	jmp	*f1@GOTPCREL(%rip)
	.cfi_endproc

Since it is OK to indirect call via memory for -mforce-indirect-call,
allow indirect branch via GOT.

	PR target/115673
	* gcc.target/i386/force-indirect-call-2.c: Allow indirect branch
	via GOT.

Signed-off-by: default avatarH.J. Lu <hjl.tools@gmail.com>
parent 319f1d04
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment