Constantine Gavrilov wrote: > I have run into problem using sigaddset() with constant signal > argument in kernel code. > ................. According to jakub@xxxxxxxx , gcc maintainer at RedHat, it is a pure kernel bug and not a gcc problem. I have reworked the patch but kept the constant case optimization. A quote form Jakub to make the issue clear: That's just buggy testcase. You need either __asm__("btsl %1,%0" : "+m"(*set) : "Ir"(_sig-1) : "cc"); or __asm__("btsl %1,%0" : "=m"(*set) : "Ir"(_sig-1), "m"(*set) : "cc"); because the btsl instruction doesn't just set the memory to some value, but needs to read its previous content as well. If you don't tell that fact to GCC, GCC is of course free to optimize as if the asm was just setting the value and not depended on the previous value. Attached please find a new patch. -- ---------------------------------------- Constantine Gavrilov Kernel Developer Qlusters Software Ltd 1 Azrieli Center, Tel-Aviv Phone: +972-3-6081977 Fax: +972-3-6081841 ----------------------------------------