Pete Popov wrote:
> in arch/mips/Makefile, we use the -mcpu=r4600 flag for MIPS32. What's
> interesting is that the use of this flag can cause the toolchain to
> generate incorrect code.
Which toolchain versions, what patches applied to it?
> For example:
> la k0, 1f
> 1: nop
> The la macro is split into a lui and a daddiu. The daddiu is not correct
> for a mips32 cpu. Getting rid of the -mcpu=4600 fixes the problem and
> the daddiu is then changed addiu.
This is IIRC a known bug in at least current binutils CVS, a patch
to fix it really was already discussed.
> Is there a truly correct -mcpu option for a mips32 cpu?
In theory, no -mcpu option (which is to be deprecated in
favor of -march/-mtune) and -mips32 as ISA flag _should_ work.
In practice, the patch which adds this to gas was discussed on the
binutils list the last days and is likely to go in CVS
today or tomorrow.