From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7A37A385482A; Wed, 27 Jan 2021 13:09:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A37A385482A From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/80960] [8/9/10/11 Regression] Huge memory use when compiling a very large test case Date: Wed, 27 Jan 2021 13:09:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 6.3.0 X-Bugzilla-Keywords: memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 8.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jan 2021 13:09:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D80960 --- Comment #24 from Richard Biener --- And we allocate plus 66M 1606M 66 million PLUS RTXen via explow.c:200 (plus_constant) 0 : 0.0% 1596= M: 92.0% 0 : 0.0% 0 : 0.0% 66M called by DSE check_mem_read_rtx and record_store. Ideally we'd not need any of that via an interface change to canon_true_dependence and friends (pass in an optional offset). Most of the time the plus RTX is already present in the original MEM. Like Breakpoint 6, record_store (body=3D0x7ffff42caa98, bb_info=3D0x3ea3b60) at /home/rguenther/src/gcc2/gcc/dse.c:1529 1529 mem_addr =3D plus_constant (get_address_mode (mem), mem_addr, offset); (reg/f:DI 19 frame) $14 =3D void (gdb) p debug_rtx (mem) (mem/c:DI (plus:DI (reg/f:DI 19 frame) (const_int -440 [0xfffffffffffffe48])) [1 MEM[(struct __st_paramete= r_dt *)_13].format_len+0 S8 A64]) $15 =3D void (gdb) p offset $16 =3D {> =3D {coeffs =3D {-440}}, } trivially pattern matching existing PLUS like if (MEM_P (mem) && GET_CODE (XEXP (mem, 0)) =3D=3D PLUS && XEXP (XEXP (mem, 0), 0) =3D=3D mem_addr && CONST_INT_P (XEXP (XEXP (mem, 0), 1)) && known_eq (offset, INTVAL (XEXP (XEXP (mem, 0), 1)))) mem_addr=3D XEXP (mem, 0); else mem_addr =3D plus_constant (get_address_mode (mem), mem_addr, offse= t); doesn't help much. Most cases seem to be build over (value:...) RTXen, those we could ggc_free I presume. Doing that in check_mem_read_rtx doesn't help though.=