aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-scopedtables.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2017-09-01 09:32:15 -0600
committerJeff Law <law@gcc.gnu.org>2017-09-01 09:32:15 -0600
commit0e34f6d842f2cd7f9aecdc32bfdc14dcf6c811e5 (patch)
treece2e148bfb473de6103fdeb11d4f303933564971 /gcc/tree-ssa-scopedtables.c
parent44acb9ba2b8ed7b588d5975773e591f477ef35c2 (diff)
downloadgcc-0e34f6d842f2cd7f9aecdc32bfdc14dcf6c811e5.zip
gcc-0e34f6d842f2cd7f9aecdc32bfdc14dcf6c811e5.tar.gz
gcc-0e34f6d842f2cd7f9aecdc32bfdc14dcf6c811e5.tar.bz2
re PR tree-optimization/82052 (ICE with "-O3 -m32" on x86_64-linux-gnu (internal compiler error: in pop_to_marker, at tree-ssa-scopedtables.c:71))
PR tree-optimization/82052 * tree-ssa-scopedtables.c (avail_exprs_stack::lookup_avail_expr): Always initialize the returned slot after a hash table miss when INSERT is true. PR tree-optimization/82052 * gcc.c-torture/compile/pr82052.c: New test. From-SVN: r251600
Diffstat (limited to 'gcc/tree-ssa-scopedtables.c')
-rw-r--r--gcc/tree-ssa-scopedtables.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/tree-ssa-scopedtables.c b/gcc/tree-ssa-scopedtables.c
index 6e1fd58..27e0c68 100644
--- a/gcc/tree-ssa-scopedtables.c
+++ b/gcc/tree-ssa-scopedtables.c
@@ -258,15 +258,24 @@ avail_exprs_stack::lookup_avail_expr (gimple *stmt, bool insert, bool tbaa_p)
{
/* If we did not find the expression in the hash table, we may still
be able to produce a result for some expressions. */
- tree alt = avail_exprs_stack::simplify_binary_operation (stmt, element);
- if (alt)
- return alt;
+ tree retval = avail_exprs_stack::simplify_binary_operation (stmt,
+ element);
+ /* We have, in effect, allocated *SLOT for ELEMENT at this point.
+ We must initialize *SLOT to a real entry, even if we found a
+ way to prove ELEMENT was a constant after not finding ELEMENT
+ in the hash table.
+
+ An uninitialized or empty slot is an indication no prior objects
+ entered into the hash table had a hash collection with ELEMENT.
+
+ If we fail to do so and had such entries in the table, they
+ would become unreachable. */
class expr_hash_elt *element2 = new expr_hash_elt (element);
*slot = element2;
record_expr (element2, NULL, '2');
- return NULL_TREE;
+ return retval;
}
/* If we found a redundant memory operation do an alias walk to