[Bug c++/35878] Useless NULL pointer check when constructing object

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 11 13:39:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35878

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #2)
> The only place I can think of where we could tell the compiler to skip this
> check is in the library. I don't know if we should add
> if(p==0)__builtin_unreachable(); somewhere, or create a new
> attribute((neverzero)) for the pointer in the vector, or something else, but
> the knowledge that the pointer is not zero belongs in the library.

Yes, I'm inclined to agree.



More information about the Gcc-bugs mailing list