* [Bug tree-optimization/106936] [13 Regression] ICE in get_value_range, at value-query.cc:170
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 ` 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
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-09-13 19:40 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106936
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
Keywords| |needs-bisection
Component|c++ |tree-optimization
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/106936] [13 Regression] ICE in get_value_range, at value-query.cc:170 since r13-1815-g8b8103dcd2624936
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 ` marxin at gcc dot gnu.org
2022-09-13 20:51 ` aldyh at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-09-13 20:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106936
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-09-13
CC| |aldyh at gcc dot gnu.org,
| |amacleod at redhat dot com,
| |marxin at gcc dot gnu.org
Summary|[13 Regression] ICE in |[13 Regression] ICE in
|get_value_range, at |get_value_range, at
|value-query.cc:170 |value-query.cc:170 since
| |r13-1815-g8b8103dcd2624936
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
Keywords|needs-bisection |
--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-1815-g8b8103dcd2624936.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/106936] [13 Regression] ICE in get_value_range, at value-query.cc:170 since r13-1815-g8b8103dcd2624936
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
2022-09-14 12:49 ` cvs-commit at gcc dot gnu.org
2022-09-14 12:49 ` aldyh at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: aldyh at gcc dot gnu.org @ 2022-09-13 20:51 UTC (permalink / raw)
To: gcc-bugs
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);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/106936] [13 Regression] ICE in get_value_range, at value-query.cc:170 since r13-1815-g8b8103dcd2624936
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
` (2 preceding siblings ...)
2022-09-13 20:51 ` aldyh at gcc dot gnu.org
@ 2022-09-14 12:49 ` cvs-commit at gcc dot gnu.org
2022-09-14 12:49 ` aldyh at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-09-14 12:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106936
--- Comment #3 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:12a8d5e2f2e7d7535115e4e105c0f9eb4d50fdad
commit r13-2663-g12a8d5e2f2e7d7535115e4e105c0f9eb4d50fdad
Author: Aldy Hernandez <aldyh@redhat.com>
Date: Wed Sep 14 14:48:36 2022 +0200
[PR106936] Remove assert from get_value_range.
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 is neither an integer nor a pointer. However, range_of_expr
happily punted on it, and then the fallthru code set the range to
VARYING. As value_range_equiv can store VARYING types of anything
(including types it can't handle), this is fine.
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.
PR tree-optimization/106936
gcc/ChangeLog:
* value-query.cc (range_query::get_value_range): Remove assert.
gcc/testsuite/ChangeLog:
* g++.dg/tree-ssa/pr106936.C: New test.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/106936] [13 Regression] ICE in get_value_range, at value-query.cc:170 since r13-1815-g8b8103dcd2624936
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
` (3 preceding siblings ...)
2022-09-14 12:49 ` cvs-commit at gcc dot gnu.org
@ 2022-09-14 12:49 ` aldyh at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: aldyh at gcc dot gnu.org @ 2022-09-14 12:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106936
Aldy Hernandez <aldyh at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
fixed
^ permalink raw reply [flat|nested] 6+ messages in thread