This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]