The following reply was made to PR target/4855; it has been noted by GNATS. From: Adrian von Bidder To: Nick Clifton , gcc Cc: Subject: Re: target/4855: arm (thumb) backend generates illegal strb instruction] Date: Tue, 20 Nov 2001 11:23:20 +0100 Nick Clifton wrote: > > Hi Adrian, > > > The bug is quite robust. It occurs with > > arm-linux-elf-gcc -mthumb -fpic -mpic-register=r6 -O2 > > Well the good news, or bad news, depending upon your point of view, is > that this bug does not appear to be reproducible with the current CVS > sources. At least not for a toolchain configured with > --target=arm-elf rather than --target=arm-linux-elf. Yo! Sorry to inform you that this problem has resurfaced and is reproducible with both arm-uclinux (my current workdir; don't use the patch I've posted some time ago) and arm-elf (from todays unmodified cvs) targets. It is, of course, highly dependent on the workings of the register allocator, so it depends on optimizer flags. arm-elf-gcc -mthumb -fpic -mpic-register=r6 -Os shouls show it with these with the newest cvs. The code from target/3218 does not seem to have the problem. 'My' code (target/4855) does still show the problem, however. [1] greets from Zürich -- vbi [1] typedef enum { REG_NOERROR = 0, REG_NOMATCH, REG_BADPAT, REG_ECOLLATE, REG_ECTYPE, REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN, REG_EBRACE, REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_EEND, REG_ESIZE, REG_ERPAREN } reg_errcode_t; typedef unsigned long int reg_syntax_t; extern int strcoll (const char *__s1, const char *__s2); reg_errcode_t compile_range (p_ptr, pend, translate, syntax, b) const char **p_ptr, *pend; char *translate; reg_syntax_t syntax; unsigned char *b; { unsigned this_char; const char *p = *p_ptr; reg_errcode_t ret; char range_start[2]; char range_end[2]; char ch[2]; if (p == pend) return REG_ERANGE; range_start[0] = p[-2]; range_start[1] = '\0'; range_end[0] = p[0]; range_end[1] = '\0'; (*p_ptr)++; ret = syntax & ((((((((((((((((((unsigned long int) 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) << 1) ? REG_ERANGE : REG_NOERROR; ch[1] = '\0'; for (this_char = 0; this_char <= (unsigned char) -1; ++this_char) { ch[0] = this_char; if (strcoll (range_start, ch) <= 0 && strcoll (ch, range_end) <= 0) { (b [((unsigned char) ((translate ? (char) translate[(unsigned char) (this_char)] : (this_char)))) / 8] |= 1 << (((unsigned char) (translate ? (char) translate[(unsigned char) (this_char)] : (this_char))) % 8)); ret = REG_NOERROR; } } return ret; }