PING^3 for PR target/17836, PR c/10735, PR c++/16882, PR rtl-optimization/17860[3.4]

David Edelsohn dje@watson.ibm.com
Sun Nov 21 05:51:00 GMT 2004


	None of your patches or responses have addressed my specific
question about testing vector type instead of testing vector mode.  Your
patch should make the minimal correction to fix the bug: passing and
returning synthetic vectors by memory.  It does not.  Your patch should
warn about returning synthetic vectors in memory.  It does not.

	I am testing the appended patch.

David

Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.746
diff -c -p -r1.746 rs6000.c
*** rs6000.c	18 Nov 2004 22:30:58 -0000	1.746
--- rs6000.c	21 Nov 2004 00:21:00 -0000
*************** rs6000_return_in_memory (tree type, tree
*** 4640,4645 ****
--- 4640,4660 ----
        && (TARGET_AIX_STRUCT_RET
  	  || (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 8))
      return true;
+ 
+   /* Return synthetic vectors in memory.  */
+   if (TREE_CODE (type) == VECTOR_TYPE
+       && int_size_in_bytes (type) > (TARGET_ALTIVEC ? 16 : 8))
+     {
+       static bool warned_for_return_big_vectors = false;
+       if (!warned_for_return_big_vectors)
+ 	{
+ 	  warning ("vector bigger than 16 bytes returned by reference: "
+ 		   "non-standard ABI extension with no compatibility guarantee");
+ 	  warned_for_return_big_vectors = true;
+ 	}
+       return true;
+     }
+ 
    if (DEFAULT_ABI == ABI_V4 && TYPE_MODE (type) == TFmode)
      return true;
    return false;
*************** function_arg_padding (enum machine_mode 
*** 4783,4792 ****
     of an argument with the specified mode and type.  If it is not defined,
     PARM_BOUNDARY is used for all arguments.
  
!    V.4 wants long longs to be double word aligned.  */
  
  int
! function_arg_boundary (enum machine_mode mode, tree type ATTRIBUTE_UNUSED)
  {
    if (DEFAULT_ABI == ABI_V4 && GET_MODE_SIZE (mode) == 8)
      return 64;
--- 4798,4810 ----
     of an argument with the specified mode and type.  If it is not defined,
     PARM_BOUNDARY is used for all arguments.
  
!    V.4 wants long longs to be double word aligned.
!    Doubleword align SPE vectors.
!    Quadword align Altivec vectors.
!    Quadword align large synthetic vector types.   */
  
  int
! function_arg_boundary (enum machine_mode mode, tree type)
  {
    if (DEFAULT_ABI == ABI_V4 && GET_MODE_SIZE (mode) == 8)
      return 64;
*************** function_arg_boundary (enum machine_mode
*** 4794,4799 ****
--- 4812,4820 ----
      return 64;
    else if (ALTIVEC_VECTOR_MODE (mode))
      return 128;
+   else if (type && TREE_CODE (type) == VECTOR_TYPE
+ 	   && int_size_in_bytes (type) > 16)
+     return 128;
    else
      return PARM_BOUNDARY;
  }
*************** rs6000_pass_by_reference (CUMULATIVE_ARG
*** 5617,5622 ****
--- 5638,5659 ----
  
        return 1;
      }
+ 
+   if (type && TREE_CODE (type) == VECTOR_TYPE
+       && int_size_in_bytes (type) > 16)
+     {
+       static bool warned_for_pass_big_vectors = false;
+       if (TARGET_DEBUG_ARG)
+ 	fprintf (stderr, "function_arg_pass_by_reference: vector >16 bytes\n");
+       if (!warned_for_pass_big_vectors)
+ 	{
+ 	  warning ("vector bigger than 16 bytes passed by reference: "
+ 		   "non-standard ABI extension with no compatibility guarantee");
+ 	  warned_for_pass_big_vectors = true;
+ 	}
+       return 1;
+     }
+ 
    return 0;
  }
  



More information about the Gcc-patches mailing list