commit 4d92a69fc5882c86aab63d52382b393d4f20b3ed
Author: Andrew MacLeod <amacleod@redhat.com>
Date: Mon Oct 18 13:52:18 2021 -0400
Process EH edges again and call get_tree_range on non gimple_range_ssa_p names.
PR tree-optimization/102796
gcc/
* gimple-range.cc (gimple_ranger::range_on_edge): Process EH edges
normally. Return get_tree_range for non gimple_range_ssa_p names.
(gimple_ranger::range_of_stmt): Use get_tree_range for non
gimple_range_ssa_p names.
gcc/testsuite/
* g++.dg/pr102796.C: New.
@@ -180,9 +180,9 @@ gimple_ranger::range_on_edge (irange &r, edge e, tree name)
int_range_max edge_range;
gcc_checking_assert (irange::supports_type_p (TREE_TYPE (name)));
- // Do not process values along abnormal or EH edges.
- if (e->flags & (EDGE_ABNORMAL|EDGE_EH))
- return false;
+ // Do not process values along abnormal edges.
+ if (e->flags & EDGE_ABNORMAL)
+ return get_tree_range (r, name, NULL);
unsigned idx;
if ((idx = tracer.header ("range_on_edge (")))
@@ -203,7 +203,7 @@ gimple_ranger::range_on_edge (irange &r, edge e, tree name)
bool res = true;
if (!gimple_range_ssa_p (name))
- res = range_of_expr (r, name);
+ return get_tree_range (r, name, NULL);
else
{
range_on_exit (r, e->src, name);
@@ -258,7 +258,7 @@ gimple_ranger::range_of_stmt (irange &r, gimple *s, tree name)
if (!name)
res = fold_range_internal (r, s, NULL_TREE);
else if (!gimple_range_ssa_p (name))
- res = false;
+ res = get_tree_range (r, name, NULL);
// Check if the stmt has already been processed, and is not stale.
else if (m_cache.get_non_stale_global_range (r, name))
{
new file mode 100644
@@ -0,0 +1,18 @@
+// { dg-do compile }
+// { dg-options "-O3 -fno-tree-ccp -fno-tree-fre -fno-tree-forwprop -std=c++17" }
+
+namespace std {
+template <class _E>
+struct initializer_list {
+ const int* __begin_;
+ decltype(sizeof(int)) __size_;
+};
+} // namespace std
+struct destroyme1 {};
+struct witharg1 {
+ witharg1(const destroyme1&);
+ ~witharg1();
+};
+std::initializer_list globalInitList2 = {witharg1(destroyme1()),
+ witharg1(destroyme1())};
+