[PATCH 06/19] bfd/RISC-V: correct grammar of conflict diagnostics
Jiawei
jiawei@iscas.ac.cn
Tue Apr 28 07:33:16 GMT 2026
> The extensions mentioned in the diagnostics can also be irritating, as one
> may not have enabled the specific one(s) mentioned. At the example of
> Zfinx, if only F was mentioned in the latter part of the message, that
> would at least be self-consistent.
>
> Furthermore the wording (particularly for uses in gas) suggests that the
> extension mentioned first is what was enabled last. Alternative, less
> suggestive wording may be "A and B conflict with one another".
>
> The usage in gas has another related issue, though: Subsets are added
> before checking for conflicts, hence e.g. for Z*inx the FPR form insns are
> then causing errors, irrespective of the order of .option directives (i.e.
> no matter which extensions were successfully enabled). Question is whether
> this infrastructure is actually well suited for use by gas.
>
The new wording is grammatically correct and clearer for diagnostics.
Regarding the broader concern mentioned in the note, I think the current
diagnostic is still useful at the assembler level. At this point we are
checking the effective ISA subset used to assemble the input, and users need
to understand which extension combinations make the assembly code invalid,
even if some of the extensions were enabled implicitly. Improving the
wording
further can still be considered separately, but this patch looks fine as a
grammar cleanup.
Best regards,
Jiawei
>
> --- a/bfd/elfxx-riscv.c
> +++ b/bfd/elfxx-riscv.c
> @@ -2245,14 +2245,14 @@ riscv_parse_check_conflicts (riscv_parse
> && riscv_lookup_subset (rps->subset_list, "f", &subset))
> {
> rps->error_handler
> - (_("`zfinx' is conflict with the `f/d/q/zfh/zfhmin' extension"));
> + (_("`zfinx' conflicts with the `f/d/q/zfh/zfhmin' extension"));
> no_conflict = false;
> }
> if (riscv_lookup_subset (rps->subset_list, "xtheadvector", &subset)
> && riscv_lookup_subset (rps->subset_list, "zve32x", &subset))
> {
> rps->error_handler
> - (_("`xtheadvector' is conflict with the `v/zve32x' extension"));
> + (_("`xtheadvector' conflicts with the `v/zve32x' extension"));
> no_conflict = false;
> }
> if (riscv_lookup_subset (rps->subset_list, "zclsd", &subset)
> @@ -2261,7 +2261,7 @@ riscv_parse_check_conflicts (riscv_parse
> || riscv_lookup_subset (rps->subset_list, "zcf", &subset)))
> {
> rps->error_handler
> - (_("`zclsd' is conflict with the `c+f'/ `zcf' extension"));
> + (_("`zclsd' conflicts with the `c+f'/`zcf' extension"));
> no_conflict = false;
> }
> if (riscv_lookup_subset (rps->subset_list, "ssnpm", &subset) &&
> xlen != 64)
> --- a/gas/testsuite/gas/riscv/x-thead-vector-fail.l
> +++ b/gas/testsuite/gas/riscv/x-thead-vector-fail.l
> @@ -1,2 +1,2 @@
> Assembler messages:
> -Error: `xtheadvector' is conflict with the `v/zve32x' extension
> +Error: `xtheadvector' conflicts with the `v/zve32x' extension
>
More information about the Binutils
mailing list