[llvm-branch-commits] [llvm-gcc-branch] r99844 - in /llvm-gcc-4.2/branches/Apple/Hermes/gcc: objc/ChangeLog.apple objc/objc-act.c testsuite/ChangeLog.apple testsuite/objc.dg/arm-scalar-atomic-copyStruct.m

Jim Grosbach grosbach at apple.com
Mon Mar 29 15:15:10 PDT 2010


Author: grosbach
Date: Mon Mar 29 17:15:10 2010
New Revision: 99844

URL: http://llvm.org/viewvc/llvm-project?rev=99844&view=rev
Log:
merge 98890, 98894, 98895

Added:
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/objc.dg/arm-scalar-atomic-copyStruct.m
Modified:
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/ChangeLog.apple
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/objc-act.c
    llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/ChangeLog.apple

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/ChangeLog.apple?rev=99844&r1=99843&r2=99844&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/ChangeLog.apple (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/ChangeLog.apple Mon Mar 29 17:15:10 2010
@@ -1,3 +1,10 @@
+2019-03-17  Jim Grosbach <grosbach at apple.com>
+
+        Radar 6671703
+	* objc-act.c (objc_synthesize_new_getter, objc_synthesize_new_setter):
+	On ARM, for atomic access to any type of larger than 4 bytes, use
+	objc_copyStruct().
+
 2009-05-06  Fariborz Jahanian <fjahanian at apple.com>
 
         Radar 6083666

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/objc-act.c?rev=99844&r1=99843&r2=99844&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/objc/objc-act.c Mon Mar 29 17:15:10 2010
@@ -16568,13 +16568,21 @@
         /* APPLE LOCAL end radar 5376125 */
 
 	/* Handle struct-valued functions */
-	if ((TREE_CODE (ret_type) == RECORD_TYPE || TREE_CODE (ret_type) == UNION_TYPE)
+        /* APPLE LOCAL begin 6671703 ARM 64-bit atomic properties */
+        if (
+#ifdef TARGET_ARM
+          (IS_ATOMIC (property)
+           && TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ret_type)) > 4) ||
+#endif
+          ((TREE_CODE (ret_type) == RECORD_TYPE
+            || TREE_CODE (ret_type) == UNION_TYPE)
             /* APPLE LOCAL radar 5080710 */
             && (TREE_ADDRESSABLE (ret_type) || targetm.calls.return_in_memory  (ret_type, 0))
-	    && (IS_ATOMIC (property) || 
-		(isStrong = ((flag_objc_gc || flag_objc_gc_only) 
-			     && aggregate_contains_objc_pointer (ret_type)))))
-	  {
+	    && (IS_ATOMIC (property) ||
+		(isStrong = ((flag_objc_gc || flag_objc_gc_only)
+			     && aggregate_contains_objc_pointer (ret_type))))))
+        /* APPLE LOCAL end 6671703 ARM 64-bit atomic properties */
+        {
 	    /* struct something tmp; 
 	       objc_copyStruct (&tmp, &structIvar, sizeof (struct something), isAtomic, false);
 	       return tmp;
@@ -16730,11 +16738,18 @@
         TREE_USED (rhs) = 1;
       /* APPLE LOCAL end radar 5232840 */
       ivar_type = TREE_TYPE (lhs);
-      if ((TREE_CODE (ivar_type) == RECORD_TYPE || TREE_CODE (ivar_type) == UNION_TYPE)
+      /* APPLE LOCAL begin 6671703 ARM 64-bit atomic properties */
+      if (
+#ifdef TARGET_ARM
+        (IS_ATOMIC (property)
+         && TREE_INT_CST_LOW (TYPE_SIZE_UNIT (ivar_type)) > 4) ||
+#endif
+       ((TREE_CODE (ivar_type) == RECORD_TYPE || TREE_CODE (ivar_type) == UNION_TYPE)
           /* APPLE LOCAL begin radar 5080710 */
           && IS_ATOMIC (property)
-          && (TREE_ADDRESSABLE (ivar_type) || targetm.calls.return_in_memory  (ivar_type, 0)))
+          && (TREE_ADDRESSABLE (ivar_type) || targetm.calls.return_in_memory  (ivar_type, 0))))
           /* APPLE LOCAL end radar 5080710 */
+      /* APPLE LOCAL end 6671703 ARM 64-bit atomic properties */
         {
 	  /* objc_copyStruct (&structIvar, &value, sizeof (struct something), true, false); */
 	  tree func_params;

Modified: llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/ChangeLog.apple
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/ChangeLog.apple?rev=99844&r1=99843&r2=99844&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/ChangeLog.apple (original)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/ChangeLog.apple Mon Mar 29 17:15:10 2010
@@ -1,3 +1,8 @@
+2010-03-18  Jim Grosbach <grosbach at apple.com>
+
+        Radar 6671703
+	* objc.dg/arm-scalar-atomic-copyStruct.m: New.
+
 2009-11-03  Stuart Hastings  <stuart at apple.com>
 
 	Radar 6951876

Added: llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/objc.dg/arm-scalar-atomic-copyStruct.m
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/objc.dg/arm-scalar-atomic-copyStruct.m?rev=99844&view=auto
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/objc.dg/arm-scalar-atomic-copyStruct.m (added)
+++ llvm-gcc-4.2/branches/Apple/Hermes/gcc/testsuite/objc.dg/arm-scalar-atomic-copyStruct.m Mon Mar 29 17:15:10 2010
@@ -0,0 +1,38 @@
+/* APPLE LOCAL file 6671703 use objc_copyStruct() for big scalars */
+/* { dg-do compile { target arm*-*-darwin* } } */
+/* { dg-options "-O0" } */
+
+#import <Foundation/NSObject.h>
+
+
+ at interface myClass : NSObject {
+  unsigned long long _i64;
+}
+
+ at property (readwrite) unsigned long long i64;
+
+ at end
+
+ at implementation myClass
+ at synthesize i64 = _i64;
+
+
+
+ at end
+
+extern int printf(const char *fmt, ...);
+
+void foo(myClass *obj)
+{
+  printf ("%llx\n", obj.i64);
+}
+
+int main()
+{
+  myClass *obj = [[myClass alloc] init];
+  obj.i64 = 0xfeedface55555555LL;
+  foo (obj);
+  return 0;
+}
+
+/* { dg-final { scan-assembler-times "blx\t_objc_copyStruct" 2 } } */





More information about the llvm-branch-commits mailing list