[gnu.gcc.bug] Oops! Bug in GAS 1.34 is probably bug in GCC 1.37

peterf@LYNX.CSIS.DIT.CSIRO.AU (Peter A Fletcher) (02/27/90)

Hello!  I've found a little bug with the GNU assembler v. 1.34
for the 68000.

GAS confuses a global variable A1 with the register
A1:

float One, A1, Two;

-------------------------------gccbug.c-----------------
main()

{
    One = 1.0;
    Two = 2.0;

    A1 = One;
    A1 = One+Two;
    One = Two/A1;
}

-------------------------------compile------------------
hera% gcc gccbug.c
/usr/tmp/cca01003.s:19:"instruction/operands mismatch" -- Statement 'fmoves fp0,A1' ignored
/usr/tmp/cca01003.s:21:"instruction/operands mismatch" -- Statement 'fsgldivs A1,fp0' ignored

-----------------------------assembler------------------
#NO_APP
gcc_compiled.:
.text
	.even
LC0:
	.long 0x3f800000
	.even
LC1:
	.long 0x40000000
	.even
.globl main
main:
	link a6,#0
	movel LC0,One
	movel LC1,Two
	movel One,A1
	fmoves One,fp0
	fadds Two,fp0
	fmoves fp0,A1
	fmoves Two,fp0
	fsgldivs A1,fp0
	fmoves fp0,One
L1:
	unlk a6
	rts
.comm Two,4
.comm A1,4
.comm One,4
-----------------------------That's all------------------

This is really easy to get around, but could be a real
pain for big programs.  (I found it in paranoia.c)

Bye now!

Peter Fletcher

peterf@csis.dit.csiro.au
Phone: (011 61 62) 750 914