diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1a70b8f..3bba89c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2018-11-15  Lokesh Janghel <lokeshjanghel91@gmail.com>
+
+	PR  target/85667
+	* i386.c (function_value_ms_64): ms_abi insist to use the eax
+	register, when function returning struct with size less than 
+	or equal to the 8 byte.
+
 2018-11-14  Richard Biener  <rguenther@suse.de>
 
 	PR middle-end/87985
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 76a92b1..70dfc98 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -9008,7 +9008,7 @@ function_value_ms_64 (machine_mode orig_mode, machine_mode mode,
 	case 8:
 	case 4:
 	  if (mode == SFmode || mode == DFmode)
-	    regno = FIRST_SSE_REG;
+	    regno = AX_REG;
 	  break;
 	default:
 	  break;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 50e53f0..ec54330 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-15 Lokesh Janghel  <lokeshjanghel91@gmail.com>
+
+	PR target/85667
+	* gcc.dg/pr85667.c: New testcase.
+ 
 2018-11-14  Richard Biener  <rguenther@suse.de>
 
 	PR middle-end/87985
diff --git a/gcc/testsuite/gcc.dg/pr85667.c b/gcc/testsuite/gcc.dg/pr85667.c
new file mode 100644
index 0000000..cc99602
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr85667.c
@@ -0,0 +1,29 @@
+/* { dg-options "-O2 " } */
+/* { dg-final { scan-assembler-times "movl\[\t \]\.\[a-zA-Z\]\[a-zA-Z\]\[0-9\]\\(%rip\\), %eax" 1} } */
+void abort ();
+typedef struct
+{
+  float x;
+} Float;
+
+Float __attribute__((ms_abi)) fn1 ()
+{
+  Float v;
+  v.x = 3.145;
+  return v;
+}
+Float fn2 ()
+{
+  Float v;
+  v.x = 3.145;
+  return v;
+}
+int main ()
+{
+  Float a, b;
+  a = fn1 ();
+  b = fn2 ();
+  if (a.x == 3.145 && b.x == 3.145)
+    return 0;
+  abort ();   
+}
