diff --git a/engine/liberty.h b/engine/liberty.h
index 416cd29..7eb1d6b 100644
--- a/engine/liberty.h
+++ b/engine/liberty.h
@@ -386,7 +386,7 @@ void add_expand_moyo_move(int pos);
 void add_strategical_attack_move(int pos, int dr);
 void add_strategical_defense_move(int pos, int dr);
 void add_worthwhile_threat_move(int pos);
-void add_replacement_move(int from, int to);
+void add_replacement_move(int from, int to, int color);
 
 /* Parameters to add_either_move and add_all_move */
 #define ATTACK_STRING  1
diff --git a/engine/move_reasons.c b/engine/move_reasons.c
index 8d8c24e..36c8c90 100644
--- a/engine/move_reasons.c
+++ b/engine/move_reasons.c
@@ -1352,10 +1352,11 @@ set_maximum_territorial_value(int pos, float value)
  * to (to). 
  */
 void
-add_replacement_move(int from, int to)
+add_replacement_move(int from, int to, int color)
 {
   int cc;
   int pos;
+  int dummy;
 
   ASSERT_ON_BOARD1(from);
   ASSERT_ON_BOARD1(to);
@@ -1365,6 +1366,13 @@ add_replacement_move(int from, int to)
   ASSERT1(board[to] == EMPTY, to);
 
   cc = replacement_map[to];
+  if (unconditionally_meaningless_move(to, color, &dummy)) {
+    /* Silently ignore replacement patterns which conflict with the
+     * unconditional analysis since the latter is always correct and
+     * it's difficult to anticipate such situations for the patterns.
+     */
+    return;
+  }
 
   /* First check for an incompatible redistribution rule. */
   if (replacement_map[from] != NO_MOVE) {
diff --git a/engine/unconditional.c b/engine/unconditional.c
index 54d5638..3640ed9 100644
--- a/engine/unconditional.c
+++ b/engine/unconditional.c
@@ -692,7 +692,7 @@ unconditional_move_reasons(int color)
       }
       else {
 	TRACE("%1m unconditionally replaced to %1m.\n", pos, replacement_move);
-	add_replacement_move(pos, replacement_move);
+	add_replacement_move(pos, replacement_move, color);
       }
     }
 }
diff --git a/patterns/helpers.c b/patterns/helpers.c
index 85f606e..1938af8 100644
--- a/patterns/helpers.c
+++ b/patterns/helpers.c
@@ -738,7 +738,7 @@ backfill_replace(int move, int str)
     if (attack_and_defend(str, NULL, NULL, NULL, &defense_move)) {
       /* Must undo the trymove before adding the replacement move. */
       popgo();
-      add_replacement_move(move, defense_move);
+      add_replacement_move(move, defense_move, board[str]);
     }
     else
       popgo();
diff --git a/patterns/mkpat.c b/patterns/mkpat.c
index 2a90abd..83ececd 100644
--- a/patterns/mkpat.c
+++ b/patterns/mkpat.c
@@ -411,7 +411,7 @@ static struct autohelper_func autohelper_functions[] = {
 		"connect_and_cut_helper2(%s, %s, %s, color)"},
   {"connect_and_cut_helper",	3, 0, 3.00, "connect_and_cut_helper(%s, %s, %s)"},
   {"owl_threatens",		2, 0, 0.01, "owl_threatens_attack(%s, %s)"},
-  {"replace",			2, 0, 0.0,  "add_replacement_move(%s, %s)"},
+  {"replace",			2, 0, 0.0,  "add_replacement_move(%s, %s, color)"},
   {"backfill_replace",		2, 0, 0.0,  "backfill_replace(%s, %s)"},
   {"non_oterritory",		1, 0, 0.0,
 		"influence_mark_non_territory(%s, color)"},

