diff options
author | Richard Biener <rguenther@suse.de> | 2023-12-04 14:50:59 +0100 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2023-12-04 15:33:58 +0100 |
commit | 0c2ea80a4ffbddc0bc29f5badaf2ae43e59483b2 (patch) | |
tree | 3eea2dce78a72ebb27d6791572b485a8f6db7b82 /gcc/cfgrtl.cc | |
parent | 82576a6e77e0a284975dda87efe4b2d5bc5b9b1c (diff) | |
download | gcc-0c2ea80a4ffbddc0bc29f5badaf2ae43e59483b2.zip gcc-0c2ea80a4ffbddc0bc29f5badaf2ae43e59483b2.tar.gz gcc-0c2ea80a4ffbddc0bc29f5badaf2ae43e59483b2.tar.bz2 |
middle-end/112785 - guard against last_clique overflow
The PR shows that we'll ICE eventually when last_clique wraps. The
following avoids this by refusing to hand out new cliques after
exhausting them. We then use zero (no clique) as conservative
fallback.
PR middle-end/112785
* function.h (get_new_clique): New inline function handling
last_clique overflow.
* cfgrtl.cc (duplicate_insn_chain): Use it.
* tree-cfg.cc (gimple_duplicate_bb): Likewise.
* tree-inline.cc (remap_dependence_clique): Likewise.
Diffstat (limited to 'gcc/cfgrtl.cc')
-rw-r--r-- | gcc/cfgrtl.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cfgrtl.cc b/gcc/cfgrtl.cc index abcb472..2a3f853 100644 --- a/gcc/cfgrtl.cc +++ b/gcc/cfgrtl.cc @@ -4385,7 +4385,7 @@ duplicate_insn_chain (rtx_insn *from, rtx_insn *to, { gcc_assert (MR_DEPENDENCE_CLIQUE (op) <= cfun->last_clique); - newc = ++cfun->last_clique; + newc = get_new_clique (cfun); } /* We cannot adjust MR_DEPENDENCE_CLIQUE in-place since MEM_EXPR is shared so make a copy and |