[llvm-commits] [llvm-gcc-4.0] r46311 - /llvm-gcc-4.0/trunk/gcc/objc/objc-act.c

Bill Wendling isanbard at gmail.com
Thu Jan 24 00:51:18 PST 2008


Author: void
Date: Thu Jan 24 02:51:17 2008
New Revision: 46311

URL: http://llvm.org/viewvc/llvm-project?rev=46311&view=rev
Log:
backporting r46308:

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.0/trunk/gcc/objc/objc-act.c

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

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





More information about the llvm-commits mailing list