diff options
author | Jan Beulich <jbeulich@suse.com> | 2023-12-01 08:28:45 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2023-12-01 08:28:45 +0100 |
commit | ce69d08114bbd64ba0bec60ba1e51438abbd45d6 (patch) | |
tree | f55ee4615fa491c3619be0ea973edeb79605e450 /gas | |
parent | 54fc4573887bfba8bd2ac0cb2eb9259e94ba178d (diff) | |
download | gdb-ce69d08114bbd64ba0bec60ba1e51438abbd45d6.zip gdb-ce69d08114bbd64ba0bec60ba1e51438abbd45d6.tar.gz gdb-ce69d08114bbd64ba0bec60ba1e51438abbd45d6.tar.bz2 |
x86: i386_cons_align() badly affects diagnostics
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.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/config/tc-i386.c | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/i386/lfence-byte.e | 5 | ||||
-rw-r--r-- | 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 f2f1e3b..e984923 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 = &seg_info(now_seg)->tc_segment_info_data.last_insn; - if (last_insn->kind != last_insn_directive - && (bfd_section_flags (now_seg) & SEC_CODE)) + if (bfd_section_flags (now_seg) & SEC_CODE) { last_insn->kind = last_insn_directive; last_insn->name = "constant directive"; last_insn->file = as_where (&last_insn->line); - if (lfence_before_ret != lfence_before_ret_none) - { - if (lfence_before_indirect_branch != 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 != lfence_branch_none) - as_warn (_("constant directive skips -mlfence-before-indirect-branch")); } } diff --git a/gas/testsuite/gas/i386/lfence-byte.e b/gas/testsuite/gas/i386/lfence-byte.e index e9475f4..cd3218e 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/gas/i386/x86-64-lfence-byte.e index e9475f4..cd3218e 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` |