The following function either reads a variable that has not been initialized or dererefernces a null pointer, but can never be executed without an error. Yet GCC issues neither -Wuninitialized/-Wmaybe-uninitialized nor -Wnull-dereference.
$ cat z.c && gcc -O2 -S -Wall -Wextra -Wnull-dereference -fdump-tree-optimized=/dev/stdout z.c
void f (int *s)
i = 0;
*s = i;
;; Function f (f, funcdef_no=0, decl_uid=1906, cgraph_uid=1, symbol_order=0)
f (int * s)
<bb 2> [local count: 1073741824]:
*s_1(D) = 0;
For the Wuninit, this is PR18501
Agreed, it's dupe of pr18501. -Wnull-dereference would benefit from the same predicate analysis as -Wmaybe-uninitialized.
*** This bug has been marked as a duplicate of bug 18501 ***