From: Jan Hubicka Date: Thu, 14 Oct 2021 13:48:01 +0000 (+0200) Subject: Fix ICE in insert_access. X-Git-Tag: upstream/12.2.0~4296 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fecd145359fc981beb2802f746190227c5cc010a;p=platform%2Fupstream%2Fgcc.git Fix ICE in insert_access. gcc/ChangeLog: PR ipa/102557 * ipa-modref-tree.h (modref_access_node::update2): Also check that parm_offset is unchanged. (modref_ref_node::insert_access): Fix updating of parameter. --- diff --git a/gcc/ipa-modref-tree.h b/gcc/ipa-modref-tree.h index 9795e2b..9976e48 100644 --- a/gcc/ipa-modref-tree.h +++ b/gcc/ipa-modref-tree.h @@ -148,7 +148,8 @@ struct GTY(()) modref_access_node poly_int64 offset1, poly_int64 size1, poly_int64 max_size1, bool record_adjustments) { - if (known_eq (offset, offset1) + if (known_eq (parm_offset, parm_offset1) + && known_eq (offset, offset1) && known_eq (size, size1) && known_eq (max_size, max_size1)) return; @@ -404,13 +405,9 @@ private: new_max_size = max_size2; else { - max_size2 = max_size2 + offset2 - offset1; - if (known_le (max_size, max_size2)) - new_max_size = max_size2; - else if (known_le (max_size2, max_size)) - new_max_size = max_size; - else - gcc_unreachable (); + new_max_size = max_size2 + offset2 - offset1; + if (known_le (new_max_size, max_size1)) + new_max_size = max_size1; } update (parm_offset1, offset1, @@ -577,6 +574,9 @@ struct GTY((user)) modref_ref_node } (*accesses)[best1].forced_merge (best2 < 0 ? a : (*accesses)[best2], record_adjustments); + /* Check that merging indeed merged ranges. */ + gcc_checking_assert ((*accesses)[best1].contains + (best2 < 0 ? a : (*accesses)[best2])); if (!(*accesses)[best1].useful_p ()) { collapse ();