summaryrefslogtreecommitdiff
path: root/gcc/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/plugin.c')
-rw-r--r--gcc/plugin.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/plugin.c b/gcc/plugin.c
index 0b5515e4907..93151f8a8a7 100644
--- a/gcc/plugin.c
+++ b/gcc/plugin.c
@@ -336,6 +336,11 @@ position_pass (struct plugin_pass *plugin_pass_info,
case PASS_POS_INSERT_AFTER:
new_pass->next = pass->next;
pass->next = new_pass;
+
+ /* Skip newly inserted pass to avoid repeated
+ insertions in the case where the new pass and the
+ existing one have the same name. */
+ pass = new_pass;
break;
case PASS_POS_INSERT_BEFORE:
new_pass->next = pass;