diff --git a/repos/base/include/util/fifo.h b/repos/base/include/util/fifo.h index f76e9fde56..3a17843804 100644 --- a/repos/base/include/util/fifo.h +++ b/repos/base/include/util/fifo.h @@ -186,6 +186,9 @@ class Genode::Fifo_element : public Fifo >::Element * Zero-pointer save: Returns 0 if this pointer is 0 to * cover the case of accessing an empty FIFO. */ + + /* prevent the compiler from optimizing out the 'this' pointer check */ + __attribute__((optimize("-fno-delete-null-pointer-checks"))) inline T *object() { if (this) { return _object; }