public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "aldyh at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106936] [13 Regression] ICE in get_value_range, at value-query.cc:170 since r13-1815-g8b8103dcd2624936 Date: Tue, 13 Sep 2022 20:51:11 +0000 [thread overview] Message-ID: <bug-106936-4-mfgKO2pir2@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-106936-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106936 --- Comment #2 from Aldy Hernandez <aldyh at gcc dot gnu.org> --- This assert was put here to make sure that the legacy get_value_range() wasn't being called on stuff that legacy couldn't handle (floats, etc), because the result would ultimately be copied into a value_range_equiv. In this case, simplify_casted_cond() is calling it on an offset_type which isn't either an integer nor a pointer, so the assert is failing. However, range_of_expr happily punted on it because it couldn't handle it, so we're just returning VARYING. As value_range_equiv can store VARYING types of anything (including types it can't handle), this is fine. I think the easiest thing to do is remove the assert. If someone from the non legacy world tries to get a non integer/pointer range here, it's going to blow up anyhow because the temporary in get_value_range is int_range_max. Anywho. This should do the trick. I'm in transit to Cauldron. Could someone test and push this? I'd hate to leave what looks like an ICE on valid code open. diff --git a/gcc/value-query.cc b/gcc/value-query.cc index 06ad5fe9708..0bdd670982b 100644 --- a/gcc/value-query.cc +++ b/gcc/value-query.cc @@ -167,7 +167,6 @@ range_query::free_value_range_equiv (value_range_equiv *v) const class value_range_equiv * range_query::get_value_range (const_tree expr, gimple *stmt) { - gcc_checking_assert (value_range_equiv::supports_p (TREE_TYPE (expr))); int_range_max r; if (range_of_expr (r, const_cast<tree> (expr), stmt)) return new (equiv_alloc->allocate ()) value_range_equiv (r);
next prev parent reply other threads:[~2022-09-13 20:51 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-13 19:35 [Bug c++/106936] New: [13 Regression] ICE in get_value_range, at value-query.cc:170 gscfq@t-online.de 2022-09-13 19:40 ` [Bug tree-optimization/106936] " pinskia at gcc dot gnu.org 2022-09-13 20:14 ` [Bug tree-optimization/106936] [13 Regression] ICE in get_value_range, at value-query.cc:170 since r13-1815-g8b8103dcd2624936 marxin at gcc dot gnu.org 2022-09-13 20:51 ` aldyh at gcc dot gnu.org [this message] 2022-09-14 12:49 ` cvs-commit at gcc dot gnu.org 2022-09-14 12:49 ` aldyh 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-106936-4-mfgKO2pir2@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).