http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50164

             Bug #: 50164
           Summary: [IRA, 4.7 Regression] Performance degradation due to
                    increased memory instructions count
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: enkovich....@gmail.com


Created attachment 25083
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25083
Reproducer

Problem occurs with -march=atom option used on the following part of test case:

  xc = (e_u8) (xc - xk);
  xm = (e_u8) (xm - xk);
  xy = (e_u8) (xy - xk);

  *EritePtr++ = xc;
  *EritePtr++ = xm;
  *EritePtr++ = xy;
  *EritePtr++ = xk;

xk has the most usages here and GCC 4.6 keeps it on register but GCC 4.7 keeps
it on stack which leads to increased number of memory instructions for that
code. On Core i7 GCC 4.7 generates code x1.5 slower than GCC 4.6. On Atom it is
~10% slower.

GCC 4.6 info:
Configured with: /export/users/mstester/stability/svn/gcc-4_6-branch/configure
--with-arch=corei7 --with-cpu=corei7 --enable-clocale=gnu --with-system-zlib
--enable-shared --with-demangler-in-ld --enable-cloog-backend=isl
--with-fpmath=sse
--prefix=/export/users/mstester/stability/work/gcc-4_6-branch/64/install
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.6.2 20110822 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-O2' '-march=atom' '-m32' '-o' 'test.4.6' '-v'

/nfs/ims/proj/icl/gcc/gnu/compilers/gcc/gcc-4_6-branch/64/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.6.2/cc1
-quiet -v -imultilib 32 -iprefix
/nfs/ims/proj/icl/gcc/gnu/compilers/gcc/gcc-4_6-branch/64/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.2/
test.c -quiet -dumpbase test.c -march=atom -m32 -auxbase test -O2 -version -o
/tmp/ccM2NIHU.s
GNU C (GCC) version 4.6.2 20110822 (prerelease) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.6.2 20110822 (prerelease), GMP version
4.3.1, MPFR version 2.4.2, MPC version 0.8.1

GCC 4.7 info:
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-master/configure --prefix=/export/gcc-master-build
Thread model: posix
gcc version 4.7.0 20110822 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-O2' '-march=atom' '-m32' '-o' 'test.4.7' '-v'
 /export/gcc-master-build/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/cc1 -quiet
-v -imultilib 32 test.c -quiet -dumpbase test.c -march=atom -m32 -auxbase test
-O2 -version -o /tmp/cc5DRHOU.s
GNU C (GCC) version 4.7.0 20110822 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.7.0 20110822 (experimental), GMP version
4.3.2, MPFR version 3.0.0, MPC version 0.8.3-dev

Reply via email to