https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96740
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic, | |missed-optimization --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- Besides the missing warnings the absence of the attribute also means that subsequent tests in the callers of the functions for the pointers being null are not optimized away as they could be if the functions made use of attribute nonnull: $ cat z.c && gcc -O2 -S -Wall -fdump-tree-optimized=/dev/stdout z.c double f0 (double x, int *p) { double y = __builtin_frexp (x, p); if (!p) __builtin_abort (); // not eliminated return y; } double f2 (const char *s) { double x = __builtin_nan (s); if (!s) __builtin_abort (); // eliminated return x; } ;; Function f0 (f0, funcdef_no=0, decl_uid=1932, cgraph_uid=1, symbol_order=0) f0 (double x, int * p) { double y; <bb 2> [local count: 1073741824]: y_5 = __builtin_frexp (x_2(D), p_3(D)); if (p_3(D) == 0B) goto <bb 3>; [0.00%] else goto <bb 4>; [100.00%] <bb 3> [count: 0]: __builtin_abort (); <bb 4> [local count: 1073741824]: return y_5; } ;; Function f2 (f2, funcdef_no=1, decl_uid=1936, cgraph_uid=2, symbol_order=1) f2 (const char * s) { double x; <bb 2> [local count: 1073741824]: x_2 = __builtin_nan (s_1(D)); [tail call] return x_2; }