error shift 32bit address to 64 bit address
NOMURA Masayoshi
mnomura@is.s.u-tokyo.ac.jp
Wed May 26 10:32:00 GMT 1999
Dear Good staffs.
The recompilation of gcc-2.95 19990524 (prelelease) by itself causes errors.
Platform ::
SunOS 5.7 Generic sun4u sparc
64 bit enviroment.
GCC version ::
GNU C version gcc-2.95 19990524 (prerelease) (sparcv9-sun-solaris2.7) compiled by GNU C version egcs-2.91.66 19990314 (egcs-1.1.2 release).
filename ::
gcc/expr.c
output ::
> stage1/xgcc -B./stage1/ -c -DIN_GCC -DHAIFA -DSVR4 -mcpu=ultrasparc -O3 -DHAVE_CONFIG_H -I. -I. -I./config -I./../include expr.c
expr.c: In function `emit_group_load':
expr.c:1930: warning: type mismatch in implicit declaration for built-in function `alloca'
/usr/ccs/bin/as: "/var/tmp/ccQHoaaa.s", line 28224: error: statement syntax
error part in Assembler code ::
.LL3894:
sra %o1, %o0, [%fp+2007] ! 137 *ashrsi3_extend [length = 1]
Description ::
The "sra" nemonic must take register for the destination,
but the code generated by gcc takes memory address.
I think the following machine description code has mistakes, ...
from config/sparc/sparc.md
(define_insn "*ashrsi3_extend"
[(set (match_operand:DI 0 "register_operand" "")
(sign_extend:DI (ashiftrt:SI (match_operand:SI 1 "register_operand" "r")
(match_operand:SI 2 "arith_operand" "r"))))]
"TARGET_ARCH64"
"sra\\t%1, %2, %0"
[(set_attr "type" "shift")
(set_attr "length" "1")])
The code,
[(set (match_operand:DI 0 "register_operand" "")
should be
[(set (match_operand:DI 0 "register_operand" "=r")
I do not know the machine description file exactly but attributions are
missed. How do you think?
Comment to prelelease 2.95 ::
I think the start and end object files are compiled and stored to
sparcv7, but this files are not used in the option "-m32".
So the linker say your specified is not good!!! like
> ld: fatal: file /usr/ccs/lib/values-Xa.o: wrong machine class
> ld: fatal: File processing errors. No output written to /tmp/test
This is because the first start file is 64bit binary format but the
next file, "/usr/ccs/lib/values-Xa.o" is not.
The file specs are not well organized for 32 bit and 64 bit enviroment.
I search the file format of specs "grep specs *info*", but I can not
find the part it explains. Oooo.
Regards.
--
NOMURA Masayoshi,
Depertment of Information Science, Faculity of Science,
University of Tokyo.
Hongoh 7-3-1, Bunkyou-ku Tokyo, 113
E-mail : mnomura@is.s.u-tokyo.ac.jp
More information about the Gcc-bugs
mailing list