[PATCH] PPC: drop redundant value conversion from md_assemble()
Alan Modra
amodra@gmail.com
Mon Dec 16 23:42:13 GMT 2024
On Mon, Dec 16, 2024 at 12:40:22PM +0100, Jan Beulich wrote:
> Just ahead of the enclosing OBJ_ELF conditional the exact same
> conversion was already carried out, with "val" not further changed in
> between.
Thanks, yes, that duplication should be removed.
> Doesn't X_unsigned also need taking into account in the remaining
> identical piece of code?
Maybe. In adding that piece of code, I was just interested in a very
limited set of expressions. The trouble with caring too much about
correctness is that someone will come along and tell you that despite
your best efforts you still didn't get it correct. ;-)
> --- a/gas/config/tc-ppc.c
> +++ b/gas/config/tc-ppc.c
> @@ -3516,13 +3516,6 @@ md_assemble (char *str)
> char *orig_str = str;
> bfd_reloc_code_real_type reloc = ppc_elf_suffix (&str, &ex);
>
> - if (ex.X_op == O_constant)
> - {
> - val = ex.X_add_number;
> - if (sizeof (ex.X_add_number) < sizeof (val)
> - && (ex.X_add_number < 0) != ex.X_extrabit)
> - val = val ^ ((addressT) -1 ^ (uint64_t) -1);
> - }
> if (reloc != BFD_RELOC_NONE)
> switch (reloc)
> {
--
Alan Modra
More information about the Binutils
mailing list