public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108639] [13 Regression] ICE on valid code at -O1 and above: in decompose, at wide-int.h:984 since r13-5578 Date: Fri, 03 Feb 2023 20:33:37 +0000 [thread overview] Message-ID: <bug-108639-4-ePoGik2aIW@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108639-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108639 --- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Aldy Hernandez <aldyh@gcc.gnu.org>: https://gcc.gnu.org/g:e261fcefb71e1270673f0457fcc73711f13d3079 commit r13-5696-ge261fcefb71e1270673f0457fcc73711f13d3079 Author: Aldy Hernandez <aldyh@redhat.com> Date: Thu Feb 2 18:08:44 2023 +0100 irange: Compare nonzero bits in irange with widest_int [PR108639] The problem here is we are trying to compare two ranges with different precisions and the == operator in wide_int is complaining. Interestingly, the problem is not the nonzero bits, but the fact that the entire ranges have different precisions. The reason we don't ICE when comparing the sub-ranges, is because the code in irange::operator== works on trees, and tree_int_cst_equal is promoting the comparison to a widest int: if (TREE_CODE (t1) == INTEGER_CST && TREE_CODE (t2) == INTEGER_CST && wi::to_widest (t1) == wi::to_widest (t2)) return 1; This is why we don't see the ICE until the nonzero bits comparison is done on wide ints. I think we should maintain the current equality behavior, and follow suit in the nonzero bit comparison. I have also fixed the legacy equality code, even though technically nonzero bits shouldn't appear in legacy. But better safe than sorry. PR tree-optimization/108639 gcc/ChangeLog: * value-range.cc (irange::legacy_equal_p): Compare nonzero bits as widest_int. (irange::operator==): Same.
next prev parent reply other threads:[~2023-02-03 20:33 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-02 14:29 [Bug tree-optimization/108639] New: ICE on valid code at -O1 and above: in decompose, at wide-int.h:984 zhendong.su at inf dot ethz.ch 2023-02-02 14:43 ` [Bug tree-optimization/108639] ]13 Regression] ICE on valid code at -O1 and above: in decompose, at wide-int.h:984 since r13-5578 jakub at gcc dot gnu.org 2023-02-02 15:11 ` jakub at gcc dot gnu.org 2023-02-02 15:31 ` jakub at gcc dot gnu.org 2023-02-02 15:47 ` jakub at gcc dot gnu.org 2023-02-02 17:13 ` [Bug tree-optimization/108639] [13 " aldyh at gcc dot gnu.org 2023-02-02 17:14 ` aldyh at gcc dot gnu.org 2023-02-02 17:15 ` aldyh at gcc dot gnu.org 2023-02-02 18:07 ` jakub at gcc dot gnu.org 2023-02-02 19:09 ` amacleod at redhat dot com 2023-02-02 19:56 ` jakub at gcc dot gnu.org 2023-02-03 7:56 ` rguenth at gcc dot gnu.org 2023-02-03 8:49 ` aldyh at gcc dot gnu.org 2023-02-03 20:33 ` cvs-commit at gcc dot gnu.org [this message] 2023-02-03 20:43 ` jakub at gcc dot gnu.org 2023-02-03 22:56 ` pinskia at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108639-4-ePoGik2aIW@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).