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]

Re: PR12928 mystery: sigsuspend.s:82: Error: non-constant expressionin ".if" statement


Daniel Kegel wrote:
For perhaps a not very good reason, I'm trying to build
a gcc-3.3.3 / glibc-2.1.3 toolchain for x86 ...

/tmp/ccdGVIRa.s: Assembler messages:
/tmp/ccdGVIRa.s:82: Error: non-constant expression in ".if" statement
/tmp/ccdGVIRa.s:83: Error: non-constant expression in ".if" statement
/tmp/ccdGVIRa.s:86: Error: non-constant expression in ".if" statement
make[2]: *** [/crosstool-0.28-pre4/build/i686-unknown-linux-gnu/gcc-3.3.3-glibc-2.1.3/build-glibc/signal/sigsuspend.o] Error 1
...
Andrew Pinski asked cryptically in http://gcc.gnu.org/PR12928
%k2 == $0?
which is exactly where I am stuck. What the heck does the %k2 in LOADARGS_1 mean?
I guess I'm showing my ignorance of inline assembly here.


And I don't understand at all how the patch in comment #11 of that
bug fixes the problem. In fact, nothing after comment #5 makes any sense...

OK, looking at comment #6 from Andrew Pinski a little harder:


>Still valid as "C" constraint, I think glibc wanted "c" here instead (and maybe "d" instead of "D"):
>Specifies constant that can be easily constructed in SSE register without loading it from memory.
>From the source:
>"aCD" (0)

I see now he's referring to the values of the ASMFMT_* macros, in this case,

#define ASMFMT_3(arg1, arg2, arg3) \
        , "aCD" (arg1), "c" (arg2), "d" (arg3)

and sure enough,
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/unix/sysv/linux/i386/sysdep.h.diff?r1=1.40&r2=1.41&cvsroot=glibc
"(ASMFMT_2): Fix typo in first parameters constraint string.
(ASMFMT_3): Likewise."
changed that somewhere between glibc-2.3.1 and 2.3.2 to read:

 #define ASMFMT_3(arg1, arg2, arg3) \
	, "aSD" (arg1), "c" (arg2), "d" (arg3)

I guess I'll try applying that patch blindly and see what happens.
http://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine%20Constraints
makes me suspect that S will cause a register instead of a constant to
be used there, which ought to fix the problem.
- Dan


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