Обсуждение: postmaster.c:802: fixed or forbidden register 2 (cx) was spilled for class CREG.
postmaster.c:802: fixed or forbidden register 2 (cx) was spilled for class CREG.
От
Oleg Bartunov
Дата:
Hi, Recently I upgraded my egcs compiler and noticed it can't compile cvs postgres ( 6.4 probably too) on my linux x86 machine. make[2]: Entering directory /home/postgres/cvs/pgsql/src/backend/postmaster' gcc -I../../include -I../../backend -O2 -mpentium -Wall -Wmissing-prototypes -I.. -c postmaster.c -o postmaster.o postmaster.c: In function `initMasks': postmaster.c:802: Invalid `asm' statement: postmaster.c:802: fixed or forbidden register 2 (cx) was spilled for class CREG. make[2]: *** [postmaster.o] Error 1 make[2]: Leaving directory /home/postgres/cvs/pgsql/src/backend/postmaster' make[1]: *** [postmaster.dir] Error 2 make[1]: Leaving directory /home/postgres/cvs/pgsql/src/backend' make: *** [all] Error 2 gcc -v Reading specs from /usr/local/egcs/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.92.21/specs gcc version egcs-2.92.21 19981109 (gcc2 ss-980609 experimental) Previous version of egcs does compile postgres ok. I read egcs FAQ and found http://egcs.cygnus.com/faq.html/#asmclobber ........ Previous releases of gcc (for example, gcc-2.7.2.X) did not detect as invalid a clobber specifier that clobbered an operand. Instead, it could spuriously and silently generate incorrect code for certain non-obvious cases of source code. Even more unfortunately, the manual (Using and Porting GCC, section Extended Asm, see the bug report entry) did not explicitly say that it was invalid to specify clobber registers that were destined to overlap operands; it could arguably be interpreted that it was correct to clobber an input operand to mark it as not holding a usable value after the asm. For the general case, there is no way to tell whether a specified clobber is intended to overlap with a specific (input) operand or is a program error, where the choice of actual register for operands failed to avoid the clobbered register. Such unavoidable overlap is detected by versions egcs-2.92.18 19981104 and above, and flagged as an error rather than accepted. An error message is given, such as: foo.c: In function `foo': foo.c:7: Invalid `asm' statement: foo.c:7: fixed or forbidden register 0 (ax) was spilled for class AREG. Unfortunately, a lot of existing software, for example the Linux kernel version 2.0.35 for the Intel x86, has constructs where input operands are marked as clobbered. ............. egcs becomes popular and people are going to use it and I think it would be great if someone could fix the problem. Regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83