Bug 101148 - [12 Regression] ranger compile-tme hog when building 527.cam4_r
Summary: [12 Regression] ranger compile-tme hog when building 527.cam4_r
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: 12.0
Assignee: Not yet assigned to anyone
URL:
Keywords: compile-time-hog
Depends on:
Blocks:
 
Reported: 2021-06-21 10:36 UTC by Richard Biener
Modified: 2021-07-14 21:58 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2021-06-21 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2021-06-21 10:36:29 UTC
Building 527.cam4_r with -march=cascadelake -Ofast -funroll-loops -flto -g -mfpmath=sse results in one ltrans partitioning never finishing compile,
not completing

Run till exit from #0  0x00000000016f620c in ranger_cache::propagate_cache (
    this=this@entry=0x7fffffffd110, name=name@entry=0x7ffff6424f30)
    at /home/rguenther/src/trunk/gcc/gimple-range-cache.cc:1027

called ultimatively from gimple-ssa-warn-restrict.c
Comment 1 Richard Biener 2021-06-21 10:37:01 UTC
I did not verify whether this occurs with GCC 11 as well.
Comment 2 Hongtao.liu 2021-06-21 10:56:46 UTC
GCC11 is ok, so is GCC20210603. I've checked that GCC20210610, GCC202010616, GCC20210621 all have this problem.
Comment 3 Martin Liška 2021-06-21 11:07:42 UTC
I'm going to reduce a test-case.
Comment 4 Martin Liška 2021-06-21 13:55:05 UTC
Hm, I ended up with quite some files:

--- /home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/FILES ---
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/cldwat.fppized.o
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/zm_conv.fppized.o
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/convect_shallow.fppized.o
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/stratiform.fppized.o
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/physpkg.fppized.o
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/cam_comp.fppized.o
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/atm_comp_mct.fppized.o
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/ccsm_comp_mod.fppized.o
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/ccsm_driver.fppized.o
/home/marxin/Programming/cpu2017/benchspec/CPU/527.cam4_r/build/build_peak_gcc-m64.0000/tphysbc.fppized.o
Comment 5 Andrew Macleod 2021-06-21 15:03:30 UTC
Any one file demonstrating it should be fine... as long as I can reproduce it large/gigantic is OK.
Comment 6 Martin Liška 2021-06-22 05:06:27 UTC
I'm going to attach one another yarpgen test-case for PR101014.
I hope it's likely the same issue as this one.
Comment 7 GCC Commits 2021-06-23 14:26:53 UTC
The master branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:

https://gcc.gnu.org/g:a03e944e92ee51ae583382079d4739b64bd93b35

commit r12-1750-ga03e944e92ee51ae583382079d4739b64bd93b35
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Tue Jun 22 17:46:05 2021 -0400

    Do not continue propagating values which cannot be set properly.
    
    If the on-entry cache cannot properly represent a range, do not continue
    trying to propagate it.
    
            PR tree-optimization/101148
            PR tree-optimization/101014
            * gimple-range-cache.cc (ranger_cache::ranger_cache): Adjust.
            (ranger_cache::~ranger_cache): Adjust.
            (ranger_cache::block_range): Check if propagation disallowed.
            (ranger_cache::propagate_cache): Disallow propagation if new value
            can't be stored properly.
            * gimple-range-cache.h (ranger_cache::m_propfail): New member.
Comment 8 Andrew Macleod 2021-06-23 14:29:09 UTC
Hopefully this closes it.  The final patch is slightly different than the proposed one in 101014, as it had to change the propagation engine slightly as well.
Comment 9 GCC Commits 2021-07-14 21:58:48 UTC
The releases/gcc-11 branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:

https://gcc.gnu.org/g:85c22c517e9571d1f0f487fd708fbb01f36f172a

commit r11-8750-g85c22c517e9571d1f0f487fd708fbb01f36f172a
Author: Andrew MacLeod <amacleod@redhat.com>
Date:   Tue Jun 22 17:46:05 2021 -0400

    Do not continue propagating values which cannot be set properly.
    
    If the on-entry cache cannot properly represent a range, do not continue
    trying to propagate it.
    
            PR tree-optimization/101148
            PR tree-optimization/101014
            * gimple-range-cache.cc (ranger_cache::ranger_cache): Adjust.
            (ranger_cache::~ranger_cache): Adjust.
            (ranger_cache::block_range): Check if propagation disallowed.
            (ranger_cache::propagate_cache): Disallow propagation if new value
            can't be stored properly.
            * gimple-range-cache.h (ranger_cache::m_propfail): New member.