schmidt%blanche.ics.uci.edu@ORION.CF.UCI.EDU ("Douglas C. Schmidt") (11/24/88)
Bug Report for GCC:
-------------------
Problem : gcc 1.31 generates invalid assembly statement for the sun 4.
1.) Version : gcc 1.31
-----------
2.) Input Program :
-----------------
/* compile with -O */
s22(pd0) /* 2.2 Identifiers (Names) */
struct defs {
int cbits; /* No. of bits per char */
int ibits; /* int */
int sbits; /* short */
int lbits; /* long */
int ubits; /* unsigned */
int fbits; /* float */
int dbits; /* double */
float fprec; /* Smallest number that can be */
float dprec; /* significantly added to 1. */
int flgs; /* Print return codes, by section */
int flgm; /* Announce machine dependencies */
int flgd; /* give explicit diagnostics */
int flgl; /* Report local return codes. */
int rrc; /* recent return code */
int crc; /* Cumulative return code */
char rfs[8]; /* Return from section */
};
struct defs *pd0;
{
int longname, a234, a;
int _, _234, A, rc;
static char s22er[] = "s22,er%d\n";
static char qs22[8] = "s22 ";
char *ps, *pt;
/* Initialize */
rc = 0;
ps = qs22;
pt = pd0 -> rfs;
while (*pt++ = *ps++);
/* An identifier is a sequence of letters and digits;
the first character must be a letter. The under-
score _ counts as a letter. */
a=1;
_=2;
_234=3;
a234=4;
if(a+_+_234+a234 != 10) {
rc = rc+1;
if(pd0->flgd != 0) printf(s22er,1);
}
/* Upper and lower case letters are different. */
A = 2;
if (A == a) {
rc = rc+4;
if (pd0->flgd != 0) printf(s22er,4);
}
return(rc);
}
3.) Command Used : gcc -0
----------------
4.) Files used :
--------------
tm.h -> tm-sparc.h
md -> sparc.md
config.h -> xm-sunos4.h
aux-output.c -> output-sparc.c
5.) Machine(s) used :
-------------------
Sun 4 running Sun4.0
6.) Compiler diagnostics :
------------------------
gcc version 1.31
/usr/public/lib/gcc/gcc-cpp -v -I/cd/ua/schmidt/include/ -undef -D__GNU__ -D__GNUC__ -Dsparc -Dsun -Dunix -D__OPTIMIZE__ asm-bug.1.31.c /tmp/cca16334.cpp
GNU CPP version 1.31
/usr/public/lib/gcc/gcc-cc1 /tmp/cca16334.cpp -quiet -dumpbase asm-bug.1.31.c -finline-functions -O -version -o /tmp/cca16334.s
GNU C version 1.31 (sparc) compiled by GNU C version 1.31.
as /tmp/cca16334.s -o asm-bug.1.31.o
as: "/tmp/cca16334.s", line 28: error: statement syntax
7). asm output
--------------
.data
_s22er.0:
.ascii "s22,er%d\12\0"
_qs22.1:
.ascii "s22 \0"
.text
.align 4
.global _s22
.proc 1
_s22:
!#PROLOGUE# 0
save %sp,-112,%sp
!#PROLOGUE# 1
mov %i0,%o3
mov 0,%l0
set _qs22.1,%o2
add %o3,60,%o1
L9:
ldsb [%o2],%o0
stb %o0,[%o1]
sll %o0,0x18,%o0
sra %o0,0x18,%o0
add %o2,1,%o2
add %o1,1,%o1
tst %o0
bne L9
nop
cmp 1,2
bne L13
nop
add %l0,4,%l0
ld [%o3+44],%o0
tst %o0
be L13
nop
set _s22er.0,%o0
call _printf,0
mov 4,%o1
L13:
mov %l0,%i0
ret
restore