Bug 67327 - Missed tail call with __noreturn__ attribute
Summary: Missed tail call with __noreturn__ attribute
Status: RESOLVED DUPLICATE of bug 10837
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-23 13:33 UTC by H.J. Lu
Modified: 2015-08-23 13:41 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2015-08-23 13:33:16 UTC
[hjl@gnu-tools-1 tmp]$ cat x.c 
extern void xxx (void) __attribute__ ((__noreturn__));
void
foo (int len)
{
  if (len)
    xxx ();
}
[hjl@gnu-tools-1 tmp]$ gcc -S -O2 x.c
[hjl@gnu-tools-1 tmp]$ cat x.s
	.file	"x.c"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB0:
	.text
.LHOTB0:
	.p2align 4,,15
	.globl	foo
	.type	foo, @function
foo:
.LFB0:
	.cfi_startproc
	testl	%edi, %edi
	jne	.L6
	rep ret
.L6:
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	xxx
	.cfi_endproc
.LFE0:
	.size	foo, .-foo
	.section	.text.unlikely
.LCOLDE0:
	.text
.LHOTE0:
	.ident	"GCC: (GNU) 5.2.1 20150716 (Red Hat 5.2.1-1)"
	.section	.note.GNU-stack,"",@progbits
[hjl@gnu-tools-1 tmp]$
Comment 1 Andrew Pinski 2015-08-23 13:34:22 UTC
I can't remember how many duplicate bugs there are of this one.

This is done on purpose.
Comment 2 Andrew Pinski 2015-08-23 13:41:10 UTC
Dup of bug 10837.

*** This bug has been marked as a duplicate of bug 10837 ***