This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Incorrect ARM Thumb code generation with gcc-3.0.2
- From: Eric PAIRE <eric dot paire at ri dot silicomp dot fr>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: paire at ri dot silicomp dot fr, lgonzale at ri dot silicomp dot fr
- Date: Fri, 23 Nov 2001 11:48:59 +0100
- Subject: Incorrect ARM Thumb code generation with gcc-3.0.2
- Reply-to: Eric PAIRE <eric dot paire at ri dot silicomp dot fr>
[Get raw message]
Hi GCC gurus,
While compiling in ARM Thumb code with gcc-3.0.2, we have hit a problem with
thumb instruction generation: You will find attached the test program for which
illegal thumb code is generated with "gcc -mthumb -c -O2 -c foo.c"
Notice that it does not occur if -O2 is not specified.
Best regards,
-Eric
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Eric PAIRE
Web : http://www.ri.silicomp.com/~paire | Groupe SILICOMP - Research Institute
Email: eric.paire@ri.silicomp.com | 2, avenue de Vignate
Phone: +33 (0) 476 63 48 71 | F-38610 Gieres
Fax : +33 (0) 476 51 05 32 | FRANCE
------ foo.c ------ foo.c ------ foo.c ------ foo.c ------ foo.c
------
char *dbg_addint(char *s, int n, int base)
{
char buf[16];
char sign = '+';
unsigned int bpos;
char *digits = "0123456789ABCDEF";
if( n < 0 ) n = -n, sign = '-';
/* Set pos to start */
bpos = 0;
/* construct digits into buffer in reverse order */
if( n == 0 ) buf[bpos++] = '0';
else while( n != 0 )
{
unsigned int d = n % base;
buf[bpos++] = digits[d];
n /= base;
}
/* set sign if negative. */
if( sign == '-' )
{
buf[bpos] = sign;
}
else bpos--;
/* Now write it out in correct order. */
while( bpos >= 0 )
*s++ = buf[bpos--];
*s = 0;
return s;
}