diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8016e51d9c7620edac4a00e63f9c55814f9998e7..cd54848866e6bc2674dfac4513df381c18ee0d46 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2011-07-28  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR target/47364
+	* config/i386/i386.md (strlen<mode>): Replace SWI48x with P.
+
 2011-07-28  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
 
 	* config/arm/vfp.md ("*movdf_vfp"): Handle the VFP constraints
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index a4435c2d232df4e36a1cefb4dbca5b2e2715c659..fce426868beb46f060f1075d56773a297e1d5bfb 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -15824,11 +15824,11 @@
    (set_attr "prefix_rep" "1")])
 
 (define_expand "strlen<mode>"
-  [(set (match_operand:SWI48x 0 "register_operand" "")
-	(unspec:SWI48x [(match_operand:BLK 1 "general_operand" "")
-			(match_operand:QI 2 "immediate_operand" "")
-			(match_operand 3 "immediate_operand" "")]
-		       UNSPEC_SCAS))]
+  [(set (match_operand:P 0 "register_operand" "")
+	(unspec:P [(match_operand:BLK 1 "general_operand" "")
+		   (match_operand:QI 2 "immediate_operand" "")
+		   (match_operand 3 "immediate_operand" "")]
+		  UNSPEC_SCAS))]
   ""
 {
  if (ix86_expand_strlen (operands[0], operands[1], operands[2], operands[3]))