This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PowerPC] gas silently replaces floating-point register for illegal gpr


On Mon, Aug 11, 2003 at 02:43:42PM +0200, Sascha Brawer wrote:
> Dear binutils/gas maintainers,
> 
> the GNU assembler 2.14.90 (cvs version of 2003-08-06) for elf32-powerpc
> accepts the following ill-formed source:
> 
> ---------------------- begin foo.s
>       .text
> foo:  lfs r0,8(r2)
> ---------------------- end foo.s
> 
> % powerpc-elf-as -mregnames foo.s
> 
> Expected behavior: An error message should be emitted because the target
> of the lfs instruction must be a floating-point register. The target
> cannot be a general-purpose register such as r0.
> 
> Observed behavior: The assembler silently replaces r0 by f0.

Instead of fixing this myself, I'll point you to the source that could
be changed to check register type, gas/config/tc-ppc.c:read_register.
read_register would need an extra parameter to pass in operand, or
possibly just operand->flags, to enable a check against expected
register type.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]