https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66010
vries at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization --- Comment #1 from vries at gcc dot gnu.org --- Before pass_stdarg, we observe in f1 that va_start and va_arg use the same argument: ... # .MEM_2 = VDEF <.MEM_1(D)> # USE = nonlocal escaped # CLB = nonlocal escaped { D.1836 } (escaped) __builtin_va_startD.1030 (&apD.1836, 0); # .MEM_3 = VDEF <.MEM_2> # USE = nonlocal null { D.1836 } (escaped) # CLB = nonlocal null { D.1836 } (escaped) res_4 = VA_ARG (&apD.1836, 0B); ... Before pass_stdarg, we observe in f2 that va_start and va_arg do not use the same argument: ... # .MEM_2 = VDEF <.MEM_1(D)> # USE = nonlocal escaped # CLB = nonlocal escaped { D.1844 } (escaped) __builtin_va_startD.1030 (&apD.1844, 0); # .MEM_3 = VDEF <.MEM_2> apD.1859 = &apD.1844; # .MEM_7 = VDEF <.MEM_3> # USE = nonlocal null { D.1844 D.1859 } (escaped) # CLB = nonlocal null { D.1844 D.1859 } (escaped) _6 = VA_ARG (&apD.1859, 0B); ... And in the pass_stdarg dump, for f2 we see why the va_list escapes: ... va_list escapes in # .MEM_3 = VDEF <.MEM_2> apD.1859 = &apD.1844; ...