[llvm-commits] [llvm-gcc-4.2] r46308 - /llvm-gcc-4.2/trunk/gcc/objc/objc-act.c

Bill Wendling isanbard at gmail.com
Thu Jan 24 00:09:19 PST 2008


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 */
     }
 }
 





More information about the llvm-commits mailing list