This is a gcc bug. The problem is that gcc incorrectly treats the expression !(!b) as an lvalue instead of rvalue. You can confirm this here. As you’ll see in the above linked demo, the output gcc gives is lvalue instead of prvalue.
The bug has been reported as:
GCC treats rvalue as an lvalue