https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87084
Bug ID: 87084 Summary: Excessive diagnostic messages for invalid use of __builtin_va_arg_pack{,_len}() in a loop Product: gcc Version: unknown Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: other Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- All gcc versions since the current trunk and down to at least 4.4 emit redundant diagnostics for each copy of the unrolled loop when compiling the following snippet w/ -O3 (or -Ofast w/ gcc versions which implement it): int xc; void zp (void) { int ta; for (ta = 0; ta < 8; ++ta) { int ij; for (ij = 0; ij < 17; ++ij) xc = __builtin_va_arg_pack () /* or __builtin_va_arg_pack_len () */; } } % gcc-9.0.0-alpha20180819 -O3 -c fz5t1wes.c fz5t1wes.c: In function 'zp': fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' 13 | xc = __builtin_va_arg_pack () /* or __builtin_va_arg_pack_len () */; | ^~~~~~~~~~~~~~~~~~~~~~~~ fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' fz5t1wes.c:13:14: error: invalid use of '__builtin_va_arg_pack ()' I believe the diagnostics should really be emitted only once for the entirety of zp().