https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117695

            Bug ID: 117695
           Summary: lto got zero score on unixbench dhry2reg on trunk
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: koule2333 at gmail dot com
  Target Milestone: ---

Created attachment 59640
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59640&action=edit
dhry_1.c dhry_2.c dhry.h timeit.c

I am using flto for unixbench but got zero score on dhry2reg, which is
unexpected.

It looks like finline-small-functions and flto lead to whole loop elimination.
Is there anyone konws more details about that?

My commands are as below:

gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O3
-fomit-frame-pointer -fforce-addr -ffast-math -Wall -flto dhry_1.c -o
dhry_1_reg.o
gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O3
-fomit-frame-pointer -fforce-addr -ffast-math -Wall -flto dhry_2.c -o
dhry_2_reg.o
gcc -o dhry2reg -DTIME -Wall -pedantic -ansi -O3 -fomit-frame-pointer
-fforce-addr -ffast-math -Wall -flto dhry_1_reg.o dhry_2_reg.o
./dhry2reg 1

and got COUNT|1|1|lps, the loop index is 1.

gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O3
-fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_1.c -o dhry_1_reg.o
gcc -c -DTIME -Wall -pedantic -ansi -DREG=register -DHZ= -O3
-fomit-frame-pointer -fforce-addr -ffast-math -Wall dhry_2.c -o dhry_2_reg.o
gcc -o dhry2reg -DTIME -Wall -pedantic -ansi -O3 -fomit-frame-pointer
-fforce-addr -ffast-math -Wall dhry_1_reg.o dhry_2_reg.o
./dhry2reg 1

and got COUNT|43740576|1|lps, the loop index is 43740576.

And you can get dhry_1.c and dhry_2.c in attachment.

Same problem on gcc-11 gcc-12 and gcc-14, except gcc-10.

Reply via email to