https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96838
Eric Gallager <egallager at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2020-08-30 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |egallager at gcc dot gnu.org --- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> --- Hm, I thought by enabling more warning options I could get a warning from one of the other ones, but, I guess not: $ /usr/local/bin/gcc -O2 -S -Wall -Wextra -pedantic -Wlarger-than=12345 -Walloc-size-larger-than=12345 -Wformat-overflow=2 -Wstringop-overflow=4 -Wshift-overflow=2 -Wstrict-overflow=5 -fdump-tree-optimized=/dev/stdout 96838.c ;; Function f (f, funcdef_no=0, decl_uid=1913, cgraph_uid=1, symbol_order=0) f (size_t n) { void * p; int _1; <bb 2> [local count: 1073741824]: n_3 = MAX_EXPR <n_2(D), 2147483648>; _1 = (int) n_3; p_6 = salloc (_1); __builtin_memset (p_6, 0, n_3); return p_6; } ;; Function g (g, funcdef_no=1, decl_uid=1917, cgraph_uid=2, symbol_order=1) g (size_t n) { void * p; unsigned int _1; <bb 2> [local count: 1073741824]: n_3 = MAX_EXPR <n_2(D), 2147483648>; _1 = (unsigned int) n_3; p_6 = ualloc (_1); __builtin_memset (p_6, 0, n_3); return p_6; } $ So, confirmed.