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

            Bug ID: 89295
           Summary: [9 regression] compilation of
                    gcc.dg-struct-layout-1/t001_x.c takes 30 times as long
                    after r268404
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

Executing on host: /home/seurer/gcc/build/gcc-trunk/gcc/xgcc
-B/home/seurer/gcc/build/gcc-trunk/gcc/    -fno-diagnostics-show-caret
-fno-diagnostics-show-line-numbers -fdiagnostics-color=never  -w
-I/home/seurer/gcc/gcc-trunk/gcc/testsuite/gcc.dg/compat -Wno-abi  -c -o
c_compat_x_tst.o
/home/seurer/gcc/build/gcc-trunk/gcc/testsuite/gcc5/gcc.dg-struct-layout-1//t001_x.c
   (timeout = 300)
spawn -ignore SIGHUP /home/seurer/gcc/build/gcc-trunk/gcc/xgcc
-B/home/seurer/gcc/build/gcc-trunk/gcc/ -fno-diagnostics-show-caret
-fno-diagnostics-show-line-numbers -fdiagnostics-color=never -w
-I/home/seurer/gcc/gcc-trunk/gcc/testsuite/gcc.dg/compat -Wno-abi -c -o
c_compat_x_tst.o
/home/seurer/gcc/build/gcc-trunk/gcc/testsuite/gcc5/gcc.dg-struct-layout-1//t001_x.c
WARNING: program timed out
compiler exited with status 1
FAIL: tmpdir-gcc.dg-struct-layout-1/t001 c_compat_x_tst.o compile

I started noticing this occasional timeout issue with this test case recently
on some of our test machines.  Note that the timeout value is 300 seconds when
run during a make check.

Trying the same test with some older revisions showed (when it is compiled
alone) that the compilation finishes in about 2s.  With recent revisions it
takes 60+s.

This may not be the only test that slows down of course.  "make -k check-gcc
RUNTESTFLAGS=struct-layout-1.exp" which runs many tests including the above
test takes about 4m30s at r268403 and about 7m at r268404.

Looking at the ftime-report outputs the big differences are in LRA
Before:
LRA non-specific                   :   0.25 ( 10%)   0.01 (  4%)   0.24 (  9%) 
  4168 kB (  5%)
LRA virtuals elimination           :   0.03 (  1%)   0.00 (  0%)   0.05 (  2%) 
   355 kB (  0%)
LRA reload inheritance             :   0.03 (  1%)   0.00 (  0%)   0.03 (  1%) 
  1618 kB (  2%)
LRA create live ranges             :   0.04 (  2%)   0.00 (  0%)   0.04 (  1%) 
   538 kB (  1%)
LRA hard reg assignment            :   0.07 (  3%)   0.00 (  0%)   0.06 (  2%) 
     0 kB (  0%)
After:
LRA non-specific                   :   7.34 ( 12%)   0.04 (  9%)   7.59 ( 13%) 
 14335 kB ( 13%)
LRA virtuals elimination           :  26.07 ( 43%)   0.06 ( 13%)  25.26 ( 42%) 
  3613 kB (  3%)
LRA reload inheritance             :   0.04 (  0%)   0.00 (  0%)   0.00 (  0%) 
  1618 kB (  2%)
LRA create live ranges             :  16.84 ( 28%)   0.06 ( 13%)  17.30 ( 29%) 
  1735 kB (  2%)
LRA hard reg assignment            :   7.53 ( 13%)   0.02 (  4%)   7.72 ( 13%) 
     0 kB (  0%)

Note:  I tried this on x86 and did not see the same slowdown between r268403
and r268404.

The trigger revision was 

------------------------------------------------------------------------
r268404 | vmakarov | 2019-01-30 15:49:23 -0600 (Wed, 30 Jan 2019) | 12 lines

2019-01-30  Vladimir Makarov  <vmaka...@redhat.com>

        PR rtl-optimization/87246
        * lra-constraints.c (simplify_operand_subreg): Reload memory
        in subreg if the address became invalid.

2019-01-30  Vladimir Makarov  <vmaka...@redhat.com>

        PR rtl-optimization/87246
        * gcc.target/i386/pr87246.c: New.

Reply via email to