Article View: gnu.gcc.bug
Article #2417bug report for Gcc V1.34, m68k
From: Jwahar R. Bammi
Date: Sat, 18 Mar 1989 06:18
Date: Sat, 18 Mar 1989 06:18
54 lines
2144 bytes
2144 bytes
Bug report for
Gcc V1.34 (as distributed) -m68000 only (-m68020 OK)
Configuration: (config.gcc sun3 (3/50, SunOS 3.5))
aux-output.c -> output-m68k.c
config.h -> xm-m68k.h
md -> m68k.md
tm.h -> tm-sun3.h
Compile Command:
gcc -O -S bug.c -m68000
Sample Program that shows the bug:
main()
{
char *s;
s = "...";
if (s[2] != '.') { /* bug from here */
foo();
}
}
Assembly Output:
#NO_APP
gcc_compiled.:
.text
LC0:
.ascii "...\0"
.even
.globl _main
_main:
link a6,#0
cmpb #46,LC0+2 <- bug here for m68000, LC0+2 is not a data alterable
jeq L2 addressing mode. (OK on m68020 where data addressing
jbsr _foo modes are allowed for second operand).
L2:
unlk a6
rts
Explaination:
The cmpb instruction on the m68000 allows only a data alterable
addressing modes for the second operand. (On the m68020 data addressing
modes are allowed, so the above example is OK). As illustraed above, gcc
generates `LC0+2' for the second operand which is not a data alterable
addressing mode, as LC0: is in the text segment (strings not being writable).
I read and re-read Chapter 11 of the manual, but cannot see how to specify
the correct constraint for this situation to the template in m68k.md for
cmpqi. (BTW i was trying to run the code on a 68000 machine (AtariST) when
i discovered this. The above example shows up the problem when
trying to run s25() of the c-torture-test suite on a m68000 system).
The cmpb instruction above, will generate an exception 4 (illegal instruction)
on a m68000 system.
--
usenet: {decvax,sun}!cwjcc!dsrgsun!bammi jwahar r. bammi
csnet: bammi@dsrgsun.ces.CWRU.edu
arpa: bammi@dsrgsun.ces.CWRU.edu
compuServe: 71515,155
Technical Details
Message-ID:
<8903180618.AA11222@dsrgsun.CES.CWRU.Edu>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!DSRGSUN.CES.CWRU.EDU!bammiShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!DSRGSUN.CES.CWRU.EDU!bammi From: bammi@DSRGSUN.CES.CWRU.EDU (Jwahar R. Bammi) Newsgroups: gnu.gcc.bug Subject: bug report for Gcc V1.34, m68k Message-ID: <8903180618.AA11222@dsrgsun.CES.CWRU.Edu> Date: 18 Mar 89 06:18:22 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 54