From cac584d529ab4468481383ed31efcb4b0c3ef756 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Thu, 11 Sep 2008 10:20:05 +0000 Subject: [PATCH] Do not mark functions with kept basic blocks (endless loops, dead ends) as "const" or "pure". [r21838] --- ir/opt/funccall.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ir/opt/funccall.c b/ir/opt/funccall.c index 1b44fa488..da0a295df 100644 --- a/ir/opt/funccall.c +++ b/ir/opt/funccall.c @@ -576,12 +576,17 @@ static unsigned check_const_or_pure_function(ir_graph *irg, int top) { if (prop != mtp_no_property) { /* check, if a keep-alive exists */ for (j = get_End_n_keepalives(end) - 1; j >= 0; --j) { - ir_node *mem = get_End_keepalive(end, j); + ir_node *kept = get_End_keepalive(end, j); - if (mode_M != get_irn_mode(mem)) + if (is_Block(kept)) { + prop = mtp_no_property; + break; + } + + if (mode_M != get_irn_mode(kept)) continue; - prop = max_property(prop, follow_mem(mem, prop)); + prop = max_property(prop, follow_mem(kept, prop)); if (prop == mtp_no_property) break; } -- 2.20.1