aboutsummaryrefslogtreecommitdiff
path: root/gcc/dse.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-01-27 15:35:52 +0100
committerRichard Biener <rguenther@suse.de>2021-01-28 09:14:46 +0100
commita523add327c6cfdd68cf9b788ea808068d0f508c (patch)
tree70405368b4b570d343d2a1b5b041beb8a3fd7ad3 /gcc/dse.c
parentfbe37371cf372b84d5b7f1a6f5f0971a513dd5fa (diff)
downloadgcc-a523add327c6cfdd68cf9b788ea808068d0f508c.zip
gcc-a523add327c6cfdd68cf9b788ea808068d0f508c.tar.gz
gcc-a523add327c6cfdd68cf9b788ea808068d0f508c.tar.bz2
rtl-optimization/80960 - avoid creating garbage RTL in DSE
The following avoids repeatedly turning VALUE RTXen into sth useful and re-applying a constant offset through get_addr via DSE check_mem_read_rtx. Instead perform this once for all stores to be visited in check_mem_read_rtx. This avoids allocating 1.6GB of garbage PLUS RTXen on the PR80960 testcase, fixing the memory usage regression from old GCC. 2021-01-27 Richard Biener <rguenther@suse.de> PR rtl-optimization/80960 * dse.c (check_mem_read_rtx): Call get_addr on the offsetted address.
Diffstat (limited to 'gcc/dse.c')
-rw-r--r--gcc/dse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/dse.c b/gcc/dse.c
index c88587e..da0df54 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -2219,6 +2219,11 @@ check_mem_read_rtx (rtx *loc, bb_info_t bb_info)
}
if (maybe_ne (offset, 0))
mem_addr = plus_constant (get_address_mode (mem), mem_addr, offset);
+ /* Avoid passing VALUE RTXen as mem_addr to canon_true_dependence
+ which will over and over re-create proper RTL and re-apply the
+ offset above. See PR80960 where we almost allocate 1.6GB of PLUS
+ RTXen that way. */
+ mem_addr = get_addr (mem_addr);
if (group_id >= 0)
{