From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1386) id A28E93858C30; Fri, 1 Dec 2023 07:30:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A28E93858C30 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jan Beulich To: bfd-cvs@sourceware.org Subject: [binutils-gdb] gas: no md_cons_align() for .nop{,s} X-Act-Checkin: binutils-gdb X-Git-Author: Jan Beulich X-Git-Refname: refs/heads/master X-Git-Oldrev: 175ce60f0ff7f3423b49c0d41a88a0c51a08ac03 X-Git-Newrev: 54fc4573887bfba8bd2ac0cb2eb9259e94ba178d Message-Id: <20231201073001.A28E93858C30@sourceware.org> Date: Fri, 1 Dec 2023 07:30:01 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Dec 2023 07:30:01 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D54fc4573887b= fba8bd2ac0cb2eb9259e94ba178d commit 54fc4573887bfba8bd2ac0cb2eb9259e94ba178d Author: Jan Beulich Date: Fri Dec 1 08:28:20 2023 +0100 gas: no md_cons_align() for .nop{,s} =20 .nop and .nops generate code, not data. Hence them invoking md_cons_align() is at best inappropriate. In fact it actually gets in the of x86'es state maintenance involving i386_cons_align(). Diff: --- gas/read.c | 8 -------- gas/testsuite/gas/i386/align-branch-6.e | 2 +- gas/testsuite/gas/i386/lfence-byte.d | 9 +++++++++ gas/testsuite/gas/i386/lfence-byte.s | 7 +++++++ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/gas/read.c b/gas/read.c index 826156db3fe..76ef86c523c 100644 --- a/gas/read.c +++ b/gas/read.c @@ -3466,10 +3466,6 @@ s_nop (int ignore ATTRIBUTE_UNUSED) md_flush_pending_output (); #endif =20 -#ifdef md_cons_align - md_cons_align (1); -#endif - SKIP_WHITESPACE (); expression (&exp); demand_empty_rest_of_line (); @@ -3519,10 +3515,6 @@ s_nops (int ignore ATTRIBUTE_UNUSED) md_flush_pending_output (); #endif =20 -#ifdef md_cons_align - md_cons_align (1); -#endif - SKIP_WHITESPACE (); expression (&exp); /* Note - this expression is tested for an absolute value in diff --git a/gas/testsuite/gas/i386/align-branch-6.e b/gas/testsuite/gas/i3= 86/align-branch-6.e index c3378353ef7..c959492cf65 100644 --- a/gas/testsuite/gas/i386/align-branch-6.e +++ b/gas/testsuite/gas/i386/align-branch-6.e @@ -1,2 +1,2 @@ .*: Assembler messages: -.*:4: Warning: `constant directive` skips -malign-branch-boundary on `jnc` +.*:5: Warning: `constant directive` skips -malign-branch-boundary on `jnc` diff --git a/gas/testsuite/gas/i386/lfence-byte.d b/gas/testsuite/gas/i386/= lfence-byte.d index 6d9a8893085..f0236a8278d 100644 --- a/gas/testsuite/gas/i386/lfence-byte.d +++ b/gas/testsuite/gas/i386/lfence-byte.d @@ -27,4 +27,13 @@ Disassembly of section .text: +[a-f0-9]+: f3 c3 repz ret +[a-f0-9]+: c3 ret +[a-f0-9]+: f3 ff d0 repz call \*%eax + +[a-f0-9]+ : + +[a-f0-9]+: 90 nop + +[a-f0-9]+: 0f ae e8 lfence + +[a-f0-9]+: ff d0 call \*%eax + +[a-f0-9]+: 8d 76 00 lea (0x)?0\(%esi\),%esi + +[a-f0-9]+: 83 0c 24 00 orl \$0x0,\(%esp\) + +[a-f0-9]+: 0f ae e8 lfence + +[a-f0-9]+: c3 ret #pass diff --git a/gas/testsuite/gas/i386/lfence-byte.s b/gas/testsuite/gas/i386/= lfence-byte.s index 0a05e6405b9..570a1c6ef35 100644 --- a/gas/testsuite/gas/i386/lfence-byte.s +++ b/gas/testsuite/gas/i386/lfence-byte.s @@ -21,3 +21,10 @@ _start: call *%eax .data .byte 0 + + .text +directive: + .nop + call *%eax + .nops 3 + ret