From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 06AD5395B442; Thu, 23 Apr 2020 18:55:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06AD5395B442 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587668106; bh=UGYfmHPMgdjt5tQ9xEPhvVQo3i+g1cZ2VAE19gWWvKM=; h=From:To:Subject:Date:From; b=IiD517XdWbW/nY6KI7TX4+NolwGjC8454vqVc08oMLFyfqSbV9u1thMxUZdrWVH06 esY0YBbW+4HywjrPDMIFZI6UHTe7y14EJ4iFKoOJN6GywxEcsYhwjsCTQ2VtQJCafp mgkdtreUPUfZQNM5+2Y12I4ETjHeWjVPp7RHtc4c= From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94736] New: Missing ENDBR at label Date: Thu, 23 Apr 2020 18:55:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2020 18:55:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94736 Bug ID: 94736 Summary: Missing ENDBR at label Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com CC: crazylht at gmail dot com Target Milestone: --- Target: i386,x86-64 [hjl@gnu-cfl-2 gcc]$ cat /tmp/foo.c #include typedef void *(*func_t) (void); void *p; void __attribute__ ((noclone, noinline)) foo (int a) { switch (a) { case 0: a0: return; case 1: a1: p =3D &&a1; case 2: a2: p =3D &&a2; case 3: a3: p =3D &&a3; case 4: a4: p =3D &&a4; case 5: a5: p =3D &&a5; case 6: a6: p =3D &&a6; case 7: a7: p =3D &&a7; case 8: a8: p =3D &&a8; case 9: a9: p =3D &&a9; case 10: a10: p =3D &&a10; default: p =3D &&a0; } goto *p; } int main () { foo (20); if (p =3D=3D NULL) abort (); ((func_t) p) (); return 0; } [hjl@gnu-cfl-2 gcc]$ ./xgcc -B./ -S -O2 -fcf-protection /tmp/foo.c [hjl@gnu-cfl-2 gcc]$ cat foo.s .file "foo.c" .text .p2align 4 .globl foo .type foo, @function foo: .LFB11: .cfi_startproc endbr64 testl %edi, %edi je .L1 .L3: endbr64 .L4: .L5: .L6: .L7: .L8: .L9: .L10: .L11: .L12: movq $.L2, p(%rip) .L2: .L1: <<<<<<<< Missing ENDBR ret .cfi_endproc .LFE11: .size foo, .-foo .section .text.unlikely,"ax",@progbits .LCOLDB0: .section .text.startup,"ax",@progbits .LHOTB0: .p2align 4 .globl main .type main, @function main: .LFB12: .cfi_startproc endbr64 subq $8, %rsp .cfi_def_cfa_offset 16 movl $20, %edi call foo movq p(%rip), %rax testq %rax, %rax je .L19 call *%rax xorl %eax, %eax addq $8, %rsp .cfi_def_cfa_offset 8 ret .cfi_endproc .section .text.unlikely .cfi_startproc .type main.cold, @function main.cold: .LFSB12: .L19: .cfi_def_cfa_offset 16 call abort .cfi_endproc .LFE12: .section .text.startup .size main, .-main .section .text.unlikely .size main.cold, .-main.cold .LCOLDE0: .section .text.startup .LHOTE0: .globl p .bss .align 8 .type p, @object .size p, 8 p: .zero 8 .ident "GCC: (GNU) 10.0.1 20200422 (experimental)" .section .note.GNU-stack,"",@progbits .section .note.gnu.property,"a" .align 8 .long 1f - 0f .long 4f - 1f .long 5 0: .string "GNU" 1: .align 8 .long 0xc0000002 .long 3f - 2f 2: .long 0x3 3: .align 8 4: [hjl@gnu-cfl-2 gcc]$=