https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117695
--- Comment #1 from 王淳洋 <koule2333 at gmail dot com> --- I have tried to merge two dhry_1.c and dhry_2.c to dhry_3.c, and do below test: gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O3 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_3.c -o dhry_3_reg.o gcc -o dhry3reg -DTIME -Wall -pedantic -ansi -O3 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_3_reg.o ./dhry3reg 1 COUNT|67876533|1|lps gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O3 -fomit-frame-pointer -fforce-addr -ffast-math -Wall -flto dhry_3.c -o dhry_3_reg.o gcc -o dhry3reg -DTIME -Wall -pedantic -ansi -O3 -fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_3_reg.o ./dhry3reg 1 COUNT|1|1|lps it seems the whole loop elimination only occurs on lto mode.