https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87986
Bug ID: 87986 Summary: Assembler errors w/ -masm=intel Product: gcc Version: unknown Status: UNCONFIRMED Keywords: assemble-failure Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- Target: x86_64-pc-linux-gnu Let's consider the following cases: % cat logpnyyb.c int bx; void ue (void) { bx = 0; } % cat rluc6lhr.c void k1 (void) { } Compiling them for x86_64 w/ -masm=intel yields the following: % gcc-9.0.0-alpha20181111 -pipe -masm=intel -c logpnyyb.c {standard input}: Assembler messages: {standard input}:15: Error: invalid use of register % cat logpnyyb.s .file "logpnyyb.c" .intel_syntax noprefix .text .comm bx,4,4 .globl ue .type ue, @function ue: .LFB0: .cfi_startproc push rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 mov rbp, rsp .cfi_def_cfa_register 6 mov DWORD PTR bx[rip], 0 nop pop rbp .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE0: .size ue, .-ue .ident "GCC: (GNU) 9.0.0-alpha20181111 20181111 (experimental)" .section .note.GNU-stack,"",@progbits % gcc-9.0.0-alpha20181111 -pipe -masm=intel -c rluc6lhr.c {standard input}: Assembler messages: {standard input}: Error: .size expression for k1 does not evaluate to a constant % cat rluc6lhr.s .file "rluc6lhr.c" .intel_syntax noprefix .text .globl k1 .type k1, @function k1: .LFB0: .cfi_startproc push rbp .cfi_def_cfa_offset 16 .cfi_offset 6, -16 mov rbp, rsp .cfi_def_cfa_register 6 nop pop rbp .cfi_def_cfa 7, 8 ret .cfi_endproc .LFE0: .size k1, .-k1 .ident "GCC: (GNU) 9.0.0-alpha20181111 20181111 (experimental)" .section .note.GNU-stack,"",@progbits Top of trunk gcc is not actually necessary, it also reproduces at least on the gcc 8 branch. I have binutils 2.31.1 installed. I'm not sure which tool, gcc or gas, might be at fault here, so I'll move this PR to the binutils Bugzilla if necessary.