Below is a gcc command line string I used to output to assembly language listing using -masm=intel. Both command line strings work, but they both produce AT&T syntax, not Intel syntax.
gcc -S -masm=intel Svx.c
but that produces a mixed Intel and AT&T syntax.
.file "Svx.c"
.intel_syntax noprefix
.text
.globl main
.type main, @function
main:
.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 -4[rbp], 0
jmp .L2
.L3:
add DWORD PTR -4[rbp], 1
.L2:
cmp DWORD PTR -4[rbp], 1000000000
jne .L3
mov eax, DWORD PTR -4[rbp]
pop rbp
.cfi_def_cfa 7, 8
ret
.cfi_endproc
.LFE0:
.size main, .-main
.ident "GCC: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0"
.section .note.GNU-stack,"",@progbits
The output looks like a modified Intel syntax, but the AT&T-specific cfi directives for stack handling are not translated. And add DWORD PTR -4[rbp],1 is not Intel syntax.
Why do I get mixed AT&T and Intel syntax with -masm=intel?