aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 9fbf58d..31322b6 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -657,6 +657,9 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
&& TREE_OPERAND (rhs, 0) == name
&& TYPE_SIZE (TREE_TYPE (rhs))
&& TYPE_SIZE (TREE_TYPE (TREE_OPERAND (def_rhs, 0)))
+ /* Function decls should not be used for VCE either as it could be
+ a function descriptor that we want and not the actual function code. */
+ && TREE_CODE (TREE_OPERAND (def_rhs, 0)) != FUNCTION_DECL
/* We should not convert volatile loads to non volatile loads. */
&& !TYPE_VOLATILE (TREE_TYPE (rhs))
&& !TYPE_VOLATILE (TREE_TYPE (TREE_OPERAND (def_rhs, 0)))