OSDN Git Service

PR target/56186
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Feb 2013 16:37:44 +0000 (16:37 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Feb 2013 16:37:44 +0000 (16:37 +0000)
        * config/i386/i386.c (function_value_ms_64): Add additional valtype
        argument and improve checking of return-argument types for 16-byte
        modes.
        (ix86_function_value_1): Add additional valtype argument on call
        of function_value_64.
        (return_in_memory_ms_64): Sync 16-byte sized mode handling with
        handling infunction_value_64 function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195721 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c

index 138f6d4..7d0988c 100644 (file)
@@ -1,3 +1,15 @@
+2013-02-04  Kai Tietz  <ktietz@redhat.com>
+
+       PR target/56186
+       * config/i386/i386.c (function_value_ms_64): Add additional valtype
+       argument and improve checking of return-argument types for 16-byte
+       modes.
+       (ix86_function_value_1): Add additional valtype argument on call
+       of function_value_64.
+       (return_in_memory_ms_64): Sync 16-byte sized mode handling with
+       handling infunction_value_64 function.
+
+
 2013-02-04  Matthew Gretton-Dann  <matthew.gretton-dann@linaro.org>
 
        * gcc/reload.c (subst_reloads): Fix DEBUG_RELOAD build issue.
index acdfa6c..895028b 100644 (file)
@@ -7336,17 +7336,24 @@ function_value_64 (enum machine_mode orig_mode, enum machine_mode mode,
 }
 
 static rtx
-function_value_ms_64 (enum machine_mode orig_mode, enum machine_mode mode)
+function_value_ms_64 (enum machine_mode orig_mode, enum machine_mode mode,
+                     const_tree valtype)
 {
   unsigned int regno = AX_REG;
 
   if (TARGET_SSE)
     {
       switch (GET_MODE_SIZE (mode))
-        {
-        case 16:
-          if((SCALAR_INT_MODE_P (mode) || VECTOR_MODE_P (mode))
-            && !COMPLEX_MODE_P (mode))
+       {
+       case 16:
+         if (valtype != NULL_TREE
+             && !VECTOR_INTEGER_TYPE_P (valtype)
+             && !VECTOR_INTEGER_TYPE_P (valtype)
+             && !INTEGRAL_TYPE_P (valtype)
+             && !VECTOR_FLOAT_TYPE_P (valtype))
+           break;
+         if ((SCALAR_INT_MODE_P (mode) || VECTOR_MODE_P (mode))
+             && !COMPLEX_MODE_P (mode))
            regno = FIRST_SSE_REG;
          break;
        case 8:
@@ -7373,7 +7380,7 @@ ix86_function_value_1 (const_tree valtype, const_tree fntype_or_decl,
   fntype = fn ? TREE_TYPE (fn) : fntype_or_decl;
 
   if (TARGET_64BIT && ix86_function_type_abi (fntype) == MS_ABI)
-    return function_value_ms_64 (orig_mode, mode);
+    return function_value_ms_64 (orig_mode, mode, valtype);
   else if (TARGET_64BIT)
     return function_value_64 (orig_mode, mode, valtype);
   else
@@ -7486,7 +7493,9 @@ return_in_memory_ms_64 (const_tree type, enum machine_mode mode)
   HOST_WIDE_INT size = int_size_in_bytes (type);
 
   /* __m128 is returned in xmm0.  */
-  if ((SCALAR_INT_MODE_P (mode) || VECTOR_MODE_P (mode))
+  if ((!type || VECTOR_INTEGER_TYPE_P (type) || INTEGRAL_TYPE_P (type)
+       || VECTOR_FLOAT_TYPE_P (type))
+      && (SCALAR_INT_MODE_P (mode) || VECTOR_MODE_P (mode))
       && !COMPLEX_MODE_P (mode) && (GET_MODE_SIZE (mode) == 16 || size == 16))
     return false;