summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2020-02-11 16:53:13 -0700
committerMartin Sebor <msebor@redhat.com>2020-02-11 16:53:13 -0700
commit9a5338e57db1cda13fa788b0e0debbcf99a475d6 (patch)
tree22a43a4dda29b013a39d82899f6b1e0ce227d0f7 /gcc/tree-ssa-alias.c
parentad21e0072e20b7c8e4d7af5ca78f24cc6ae407d1 (diff)
PR tree-optimization/93683 - ICE on calloc with unused return value in ao_ref_init_from_ptr_and_size
gcc/testsuite/ChangeLog: PR tree-optimization/93683 * gcc.dg/tree-ssa/ssa-dse-39.c: New test. gcc/ChangeLog: PR tree-optimization/93683 * tree-ssa-alias.c (stmt_kills_ref_p): Avoid using LHS when not set.
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index c7e6679f990..fd781050668 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -3265,6 +3265,8 @@ stmt_kills_ref_p (gimple *stmt, ao_ref *ref)
return false;
dest = gimple_call_lhs (stmt);
+ if (!dest)
+ return false;
len = fold_build2 (MULT_EXPR, TREE_TYPE (arg0), arg0, arg1);
}
else