aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-threadedge.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-threadedge.c')
-rw-r--r--gcc/tree-ssa-threadedge.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index f43d581..32d63a9 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -265,6 +265,12 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
&& gimple_call_internal_unique_p (stmt))
return NULL;
+ /* We cannot thread through __builtin_constant_p, because an
+ expression that is constant on two threading paths may become
+ non-constant (i.e.: phi) when they merge. */
+ if (gimple_call_builtin_p (stmt, BUILT_IN_CONSTANT_P))
+ return NULL;
+
/* If duplicating this block is going to cause too much code
expansion, then do not thread through this block. */
stmt_count++;