https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117315
--- Comment #14 from Sam James <sjames at gcc dot gnu.org> --- Looking at this again, wmem_tree_new_autoreset has __attribute__((malloc)) which promises that the memory returned isn't aliased by anything else ("fresh"). In wmem_test_tree, we birth 'tree' with wmem_tree_new_autoreset, but tree is a pointer to freshly allocated memory, while tree->data_allocator is a pointer to one of its arguments. I think we assume it can't be null as a result later on which is why -fno-delete-null-pointer-checks works. Is this like a 'lifetime-dse' thing? Is it legal for wmem_tree_new_autoreset to modify 'tree' before it's returned like that for the malloc attribute?