From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1386) id B5F5C385AC1B; Fri, 1 Dec 2023 07:30:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B5F5C385AC1B 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] x86: i386_cons_align() badly affects diagnostics X-Act-Checkin: binutils-gdb X-Git-Author: Jan Beulich X-Git-Refname: refs/heads/master X-Git-Oldrev: 54fc4573887bfba8bd2ac0cb2eb9259e94ba178d X-Git-Newrev: ce69d08114bbd64ba0bec60ba1e51438abbd45d6 Message-Id: <20231201073006.B5F5C385AC1B@sourceware.org> Date: Fri, 1 Dec 2023 07:30:06 +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:06 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dce69d08114bb= d64ba0bec60ba1e51438abbd45d6 commit ce69d08114bbd64ba0bec60ba1e51438abbd45d6 Author: Jan Beulich Date: Fri Dec 1 08:28:45 2023 +0100 x86: i386_cons_align() badly affects diagnostics =20 Warning without knowing what's going to follow isn't useful, the more that appropriate warnings are emitted elsewhere in all cases. Not updating state (file/line in particular) also isn't helpful, as it's always the last directive ahead of a construct potentially needing fiddling with that's "guilty" in that fiddling being suppressed. Diff: --- gas/config/tc-i386.c | 13 +------------ gas/testsuite/gas/i386/lfence-byte.e | 5 +---- gas/testsuite/gas/i386/x86-64-lfence-byte.e | 5 +---- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index f2f1e3b9f64..e984923ec35 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -15491,22 +15491,11 @@ i386_cons_align (int ignore ATTRIBUTE_UNUSED) struct last_insn *last_insn =3D &seg_info(now_seg)->tc_segment_info_data.last_insn; =20 - if (last_insn->kind !=3D last_insn_directive - && (bfd_section_flags (now_seg) & SEC_CODE)) + if (bfd_section_flags (now_seg) & SEC_CODE) { last_insn->kind =3D last_insn_directive; last_insn->name =3D "constant directive"; last_insn->file =3D as_where (&last_insn->line); - if (lfence_before_ret !=3D lfence_before_ret_none) - { - if (lfence_before_indirect_branch !=3D lfence_branch_none) - as_warn (_("constant directive skips -mlfence-before-ret " - "and -mlfence-before-indirect-branch")); - else - as_warn (_("constant directive skips -mlfence-before-ret")); - } - else if (lfence_before_indirect_branch !=3D lfence_branch_none) - as_warn (_("constant directive skips -mlfence-before-indirect-branch")); } } =20 diff --git a/gas/testsuite/gas/i386/lfence-byte.e b/gas/testsuite/gas/i386/= lfence-byte.e index e9475f40a95..cd3218e52f6 100644 --- a/gas/testsuite/gas/i386/lfence-byte.e +++ b/gas/testsuite/gas/i386/lfence-byte.e @@ -1,9 +1,6 @@ .*: Assembler messages: .*:5: Warning: `rep` skips -mlfence-before-ret on `ret` .*:7: Warning: `rep` skips -mlfence-before-ret on `ret` -.*:10: Warning: constant directive skips -mlfence-before-ret and -mlfence-= before-indirect-branch .*:13: Warning: `rep` skips -mlfence-before-ret on `ret` -.*:17: Warning: constant directive skips -mlfence-before-ret and -mlfence-= before-indirect-branch -.*:17: Warning: `constant directive` skips -mlfence-before-ret on `ret` -.*:20: Warning: constant directive skips -mlfence-before-ret and -mlfence-= before-indirect-branch +.*:18: Warning: `constant directive` skips -mlfence-before-ret on `ret` .*:20: Warning: `constant directive` skips -mlfence-before-indirect-branch= on `call` diff --git a/gas/testsuite/gas/i386/x86-64-lfence-byte.e b/gas/testsuite/ga= s/i386/x86-64-lfence-byte.e index e9475f40a95..cd3218e52f6 100644 --- a/gas/testsuite/gas/i386/x86-64-lfence-byte.e +++ b/gas/testsuite/gas/i386/x86-64-lfence-byte.e @@ -1,9 +1,6 @@ .*: Assembler messages: .*:5: Warning: `rep` skips -mlfence-before-ret on `ret` .*:7: Warning: `rep` skips -mlfence-before-ret on `ret` -.*:10: Warning: constant directive skips -mlfence-before-ret and -mlfence-= before-indirect-branch .*:13: Warning: `rep` skips -mlfence-before-ret on `ret` -.*:17: Warning: constant directive skips -mlfence-before-ret and -mlfence-= before-indirect-branch -.*:17: Warning: `constant directive` skips -mlfence-before-ret on `ret` -.*:20: Warning: constant directive skips -mlfence-before-ret and -mlfence-= before-indirect-branch +.*:18: Warning: `constant directive` skips -mlfence-before-ret on `ret` .*:20: Warning: `constant directive` skips -mlfence-before-indirect-branch= on `call`