Author: void
Date: Thu Jan 24 02:09:17 2008
New Revision: 46308

URL: http://llvm.org/viewvc/llvm-project?rev=46308&view=rev
Log:
The initialization for _OBJC_IVAR_$_<classname>.b<integer> symbols are dropped
for -O0. As it turns out, the LLVM variable is created at -O0 before the
initialization is set to the correct value. It defaults to 0, so these use the
zero filled directive, which is wrong.

Reset the initialization on LLVM variables when needed.

objc2-bitfield-abi-1.m is a testcase that exercises this.

Modified:
    llvm-gcc-4.2/trunk/gcc/objc/objc-act.c

Modified: llvm-gcc-4.2/trunk/gcc/objc/objc-act.c
URL: 
http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/objc/objc-act.c?rev=46308&r1=46307&r2=46308&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.2/trunk/gcc/objc/objc-act.c Thu Jan 24 02:09:17 2008
@@ -10659,6 +10659,13 @@
       tree decl = TREE_PURPOSE (chain);
       tree offset = TREE_VALUE (chain);
       finish_var_decl (decl, offset);      
+      /* LOCAL LLVM begin - radar 5698757 */
+#ifdef ENABLE_LLVM
+      /* Reset the initializer for this reference as it may have changed with
+         -O0  */
+      reset_initializer_llvm (decl);
+#endif
+      /* LOCAL LLVM end - radar 5698757 */
     }
 }
 


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to