public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626
@ 2018-11-15  9:02 Umesh Kalappa
  2018-11-15 10:24 ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85667 Umesh Kalappa
  2018-11-15 10:32 ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Richard Biener
  0 siblings, 2 replies; 16+ messages in thread
From: Umesh Kalappa @ 2018-11-15  9:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: lokeshjanghel91

[-- Attachment #1: Type: text/plain, Size: 173 bytes --]

Hi All,

The attached patch (pr85667.patch) fixes the subjected issue .
we tested on x86_64(linux and windows both) and no regress found .

ok to commit ?

Thank you
~Umesh

[-- Attachment #2: pr85667.patch --]
[-- Type: application/octet-stream, Size: 1725 bytes --]

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1a70b8f..f385e24 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 don't use the sse
+	(xmm0) register when returning structs whose size is 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..5b76261 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.target/pr85667.c: New testcase.
+ 
 2018-11-14  Richard Biener  <rguenther@suse.de>
 
 	PR middle-end/87985
diff --git a/gcc/testsuite/gcc.target/i386/pr85667.c b/gcc/testsuite/gcc.target/i386/pr85667.c
new file mode 100644
index 0000000..657a0f0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr85667.c
@@ -0,0 +1,20 @@
+/* { dg-options "-O2 " } */
+/* { dg-final { scan-assembler-times "movl\[\t \]\.\[a-zA-Z\]\[a-zA-Z\]\[0-9\]\\(%rip\\), %eax" 1} } */
+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;
+}

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-01-06 17:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-15  9:02 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Umesh Kalappa
2018-11-15 10:24 ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85667 Umesh Kalappa
2018-11-15 10:32 ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Richard Biener
2018-11-16  8:07   ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Umesh Kalappa
2018-11-16  9:08     ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Richard Biener
2018-11-16 10:51       ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Umesh Kalappa
2018-11-16 11:27         ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Jakub Jelinek
     [not found]           ` <CACcU4_r4GESOudiV+4FYq9Drg3kJuCdyVVpvnTTqV=Y-=xoDjQ@mail.gmail.com>
2018-11-19 10:38             ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Lokesh Janghel
2018-11-20  9:33               ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Jakub Jelinek
2018-11-21 12:36                 ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Umesh Kalappa
2018-11-21 13:07                   ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Jakub Jelinek
2018-11-21 13:25                     ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Umesh Kalappa
2018-11-26 21:46                       ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Jeff Law
2019-01-06 17:25               ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Martin Liška
2019-01-06 17:29                 ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Jakub Jelinek
2018-11-20  6:59             ` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87626 Umesh Kalappa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).