I have run into problem using sigaddset() with constant signal argument in kernel code. A code like the following gets miscompiled: sigset_t a; sigset_t b; sigset_t c; ........... sigaddset(&a, const1); sigaddset(&a, const2); ................................ b =a; /* this line causes incorrect code; any 64-bit assignment seems to cause a problem! */ sigaddset(&c, const2); sigaddset(&c, const3); /* more sigaddset to c */ All versions of compilers and all kernel versions are affected. The problem is also reproducible in user space (with kernel sigaddset definition). Looking at the dissassembly (or running in the debugger) clearly shows that gcc miscompiled the code. Attached please find a C code (can be compiled into module or executable) that demonstrates the problem. Attached is also a patch that fixes the problem (the patch was prepared against 2.6 tree). I defined sigaddset a macro (similar to sigismember) that calls one function for constant argument and another for variable. In addition to fixing the problem, it also makes sigaddset() faster for constant arguments. To be on the safe side, I changed sigdelset() in the same way (I think the same gcc bug may apply). -- ---------------------------------------- Constantine Gavrilov Kernel Developer Qlusters Software Ltd 1 Azrieli Center, Tel-Aviv Phone: +972-3-6081977 Fax: +972-3-6081841 ----------------------------------------