Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
b089226e
Commit
b089226e
authored
Feb 16, 2016
by
yb9976
Browse files
Do not modify the graph while walking over it.
This fixes opt/fehler318.c.
parent
08a9fb97
Changes
1
Hide whitespace changes
Inline
Side-by-side
ir/opt/irgopt.c
View file @
b089226e
...
...
@@ -57,8 +57,9 @@ void local_optimize_node(ir_node *n)
ir_free_resources
(
irg
,
IR_RESOURCE_IRN_LINK
);
}
static
void
enqueue_node
(
ir_node
*
node
,
pdeq
*
waitq
)
static
void
enqueue_node
(
ir_node
*
node
,
void
*
env
)
{
pdeq
*
waitq
=
(
pdeq
*
)
env
;
if
(
get_irn_link
(
node
)
==
waitq
)
return
;
pdeq_putr
(
waitq
,
node
);
...
...
@@ -173,7 +174,7 @@ void optimize_graph_df(ir_graph *irg)
constbits_analyze
(
irg
);
irg_walk_graph
(
irg
,
NULL
,
opt_walker
,
waitq
);
irg_walk_graph
(
irg
,
NULL
,
enqueue_node
,
waitq
);
/* any optimized nodes are stored in the wait queue,
* so if it's not empty, the graph has been changed */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment