diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-11 07:34:09 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-11 07:34:09 +0000 |
commit | 8ecc6f010388169eae58fb2b1c54ef404fd38f6b (patch) | |
tree | 90a319bf42d7d6bc1abc0e0b94bf8af1853a0f95 /gcc/tree-ssa-sccvn.c | |
parent | 6f1afc194c487ef2ff8c700759c76db773960ce6 (diff) | |
download | gcc-8ecc6f010388169eae58fb2b1c54ef404fd38f6b.tar.gz |
2009-04-11 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39713
* tree-ssa-sccvn.c (vn_get_expr_for): Make sure built
reference trees have SSA_NAME operands.
* g++.dg/torture/pr39713.C: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145951 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 416fa7f69a6..f3b00e99b48 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -257,9 +257,10 @@ vn_get_expr_for (tree name) switch (TREE_CODE_CLASS (gimple_assign_rhs_code (def_stmt))) { case tcc_reference: - if (gimple_assign_rhs_code (def_stmt) == VIEW_CONVERT_EXPR - || gimple_assign_rhs_code (def_stmt) == REALPART_EXPR - || gimple_assign_rhs_code (def_stmt) == IMAGPART_EXPR) + if ((gimple_assign_rhs_code (def_stmt) == VIEW_CONVERT_EXPR + || gimple_assign_rhs_code (def_stmt) == REALPART_EXPR + || gimple_assign_rhs_code (def_stmt) == IMAGPART_EXPR) + && TREE_CODE (gimple_assign_rhs1 (def_stmt)) == SSA_NAME) expr = fold_build1 (gimple_assign_rhs_code (def_stmt), gimple_expr_type (def_stmt), TREE_OPERAND (gimple_assign_rhs1 (def_stmt), 0)); |