]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/fold-const.c
re PR c/20318 (RFE: add attribute to specify that a function never returns NULL)
[gcc.git] / gcc / fold-const.c
index 03d62f51721d8220bb72315265b8d6149aa56ade..c4c09b65eb1be1c5273a63d9376da8ce94360640 100644 (file)
@@ -16229,6 +16229,10 @@ tree_expr_nonzero_warnv_p (tree t, bool *strict_overflow_p)
            && DECL_IS_OPERATOR_NEW (fndecl)
            && !TREE_NOTHROW (fndecl))
          return true;
+       if (flag_delete_null_pointer_checks
+           && lookup_attribute ("returns_nonnull",
+                TYPE_ATTRIBUTES (TREE_TYPE (fndecl))))
+         return true;
        return alloca_call_p (t);
       }
 
This page took 0.036677 seconds and 5 git commands to generate.