This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC 3.2.1 Bug on XScale?
- From: "Zhang, Yun" <yun dot zhang at intel dot com>
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Fri, 21 Mar 2003 16:40:21 +0800
- Subject: GCC 3.2.1 Bug on XScale?
Hi, all
I found out that with a simple test case: (GCC configured --target=arm-linux
--prefix=$PREFIX $HOST --with-headers=$KERNEL/include --disable-shared
--disable-threads --enable-languages="c" --nfp --with-cpu=xscale
--without-fp --with-softfloat-support=internal )
"
int main () {
char ch = -2;
int i = ch;
printf ("%d", i);
}
GCC 3.2.1 compiled code is (Debug version. Release is right):
"
mvn r3, #1
strb r3, [fp, #-13]
ldrb r3, [fp, #-13] @zero-extendedqisi2
......."
In fact, r3 should be signed extended. Embedded VC generated code seems to
be correct:
"
mvn r0, #1
strb r0, [sp, #4]
ldrsb r1, [sp, #4]
"
Is this a gcc bug? Which gcc patch could fix this problem?
Thanks,
Yun