This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problems with stepanov and inlining on the main line


Function inlining seems to cause a huge pessimisation for the current 3.1
g++ compiler on the i686-pc-linux-gnu target. The abstraction penalty
is 7.4 in contrast to 1.2 when only the -O2 optimisation level is
active and 6.76 without any optimisation. 

By the way, the abstraction penalties for gcc 2.95.2 are 1.06
for the -O2 and 1.01 for the -O3 optimisation level.

I suggest that some application tests are added to the g++ regression
test suite. 

Could someone please fix the inlining problem.

Peter Schmid

g++ -v -W -Wall stepanov_v1p2.C -O3
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc/configure --enable-shared --enable-threads=posix --enable-languages=c,c++,f77,objc --disable-nls --enable-clocale=gnu
Thread model: posix
gcc version 3.1 20010804 (experimental)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=1 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -W -Wall -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ stepanov_v1p2.C -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -D__GXX_ABI_VERSION=100 -quiet -dumpbase stepanov_v1p2.C -O3 -W -Wall -version -o /tmp/ccxJyLQN.s
GNU CPP version 3.1 20010804 (experimental) (cpplib) (i386 Linux/ELF)
GNU C++ version 3.1 20010804 (experimental) (i686-pc-linux-gnu)
	compiled by GNU C version 3.1 20010804 (experimental).
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++-v3
 /usr/local/include/g++-v3/i686-pc-linux-gnu
 /usr/local/include/g++-v3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o /tmp/ccDvxVgR.o /tmp/ccxJyLQN.s
GNU assembler version 2.11.90.0.23 (i686-pc-linux-gnu) using BFD version 2.11.90.0.23
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/collect2 -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtbegin.o -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1 -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../../../i686-pc-linux-gnu/lib -L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/../../.. /tmp/ccDvxVgR.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/crtend.o /usr/lib/crtn.o

-O3
time ./a.out

test      absolute   additions      ratio with
number    time       per second     test0

 0        0.44sec    113.64M         1.00
 1        0.48sec    104.17M         1.09
 2        0.48sec    104.17M         1.09
 3        4.51sec    11.09M         10.25
 4        5.94sec     8.42M         13.50
 5        2.84sec    17.61M         6.45
 6        6.92sec     7.23M         15.73
 7        3.98sec    12.56M         9.05
 8        9.87sec     5.07M         22.43
 9        5.02sec     9.96M         11.41
10        7.24sec     6.91M         16.45
11        7.12sec     7.02M         16.18
12        8.57sec     5.83M         19.48
mean:     3.26sec    15.35M         7.40

Total absolute time: 63.41 sec

Abstraction Penalty: 7.40


real	1m4.071s
user	1m3.430s
sys	0m0.000s

-O2

time ./a.out

test      absolute   additions      ratio with
number    time       per second     test0

 0        0.44sec    113.64M         1.00
 1        0.45sec    111.11M         1.02
 2        0.46sec    108.70M         1.05
 3        0.57sec    87.72M         1.30
 4        0.52sec    96.15M         1.18
 5        0.57sec    87.72M         1.30
 6        0.51sec    98.04M         1.16
 7        0.58sec    86.21M         1.32
 8        0.49sec    102.04M         1.11
 9        0.56sec    89.29M         1.27
10        0.51sec    98.04M         1.16
11        0.97sec    51.55M         2.20
12        0.96sec    52.08M         2.18
mean:     0.56sec    88.55M         1.28

Total absolute time: 7.59 sec

Abstraction Penalty: 1.28


real	0m7.830s
user	0m7.610s
sys	0m0.010s

no optimisation
./a.out

test      absolute   additions      ratio with
number    time       per second     test0

 0        2.11sec    23.70M         1.00
 1        2.51sec    19.92M         1.19
 2        8.07sec     6.20M         3.82
 3       13.13sec     3.81M         6.22
 4       20.43sec     2.45M         9.68
 5       14.32sec     3.49M         6.79
 6       21.71sec     2.30M         10.29
 7       19.01sec     2.63M         9.01
 8       27.41sec     1.82M         12.99
 9       20.53sec     2.44M         9.73
10       28.80sec     1.74M         13.65
11       26.47sec     1.89M         12.55
12       34.94sec     1.43M         16.56
mean:    14.27sec     3.50M         6.76

Total absolute time: 239.44 sec

Abstraction Penalty: 6.76


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]