This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Simplify mips16 conversion to even address
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Richard Sandiford <rsandifo at redhat dot com>
- Cc: fnf at redhat dot com, binutils at sources dot redhat dot com
- Date: Sun, 7 Mar 2004 00:11:29 +1030
- Subject: Re: [PATCH] Simplify mips16 conversion to even address
- References: <200403042153.58621.fnf@ninemoons.com> <87u112xl4c.fsf@redhat.com>
On Sat, Mar 06, 2004 at 11:36:51AM +0000, Richard Sandiford wrote:
> Fred Fish <fnf@ninemoons.com> writes:
> > + if (sym->st_other == STO_MIPS16)
> > + sym->st_value &= ~1;
>
> This isn't 64-bit clean, is it?
No, it's OK. `1' is an int. ~1 is too, == -2. -2 is sign extended
when promoting to larger integer types. ~0x1 would be a different
story, because hex constants are unsigned.
I know a lot of my code uses `~(bfd_vma) 1', but that's because I'm
paranoid.. (I also have run into some old C compilers that didn't
sign extend, but with binutils now requiring an ISO C compiler I
think we're safe.)
--
Alan Modra
IBM OzLabs - Linux Technology Centre