projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c887f4
)
ensure that the tail call is in the same block as the return (fixes fehler62)
author
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Tue, 7 Aug 2007 11:17:14 +0000
(11:17 +0000)
committer
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Tue, 7 Aug 2007 11:17:14 +0000
(11:17 +0000)
[r15487]
ir/opt/tailrec.c
patch
|
blob
|
history
diff --git
a/ir/opt/tailrec.c
b/ir/opt/tailrec.c
index
ea75333
..
7db1fea
100644
(file)
--- a/
ir/opt/tailrec.c
+++ b/
ir/opt/tailrec.c
@@
-328,13
+328,14
@@
int opt_tail_rec_irg(ir_graph *irg) {
if (! is_Call(call))
continue;
+ /* the call must be in the same block as the return */
+ if (get_nodes_block(call) != get_nodes_block(ret))
+ continue;
+
/* check if it's a recursive call */
call_ptr = get_Call_ptr(call);
- if (get_irn_op(call_ptr) != op_SymConst)
- continue;
-
- if (get_SymConst_kind(call_ptr) != symconst_addr_ent)
+ if (! is_SymConst(call_ptr) || get_SymConst_kind(call_ptr) != symconst_addr_ent)
continue;
ent = get_SymConst_entity(call_ptr);