[llvm-commits] [llvm-gcc-4.0] r42571 - /llvm-gcc-4.0/trunk/gcc/c-typeck.c
Chris Lattner
sabre at nondot.org
Tue Oct 2 22:31:52 PDT 2007
Author: lattner
Date: Wed Oct 3 00:31:52 2007
New Revision: 42571
URL: http://llvm.org/viewvc/llvm-project?rev=42571&view=rev
Log:
Fix PR1647 and test/CFrontend/2007-10-02-VolatileArray.c
Modified:
llvm-gcc-4.0/trunk/gcc/c-typeck.c
Modified: llvm-gcc-4.0/trunk/gcc/c-typeck.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/c-typeck.c?rev=42571&r1=42570&r2=42571&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/c-typeck.c (original)
+++ llvm-gcc-4.0/trunk/gcc/c-typeck.c Wed Oct 3 00:31:52 2007
@@ -1901,7 +1901,11 @@
if (TREE_CODE(ty) == RECORD_TYPE || TREE_CODE(ty) == UNION_TYPE
|| TREE_CODE(ty) == QUAL_UNION_TYPE)
ty = TYPE_MAIN_VARIANT (ty);
- return build4 (ARRAY_REF, ty, ar, index, NULL_TREE, NULL_TREE);
+
+ ar = build4 (ARRAY_REF, ty, ar, index, NULL_TREE, NULL_TREE);
+ /* mirror logic from build_indirect_ref to set TREE_THIS_VOLATILE. */
+ TREE_THIS_VOLATILE(ar) = TYPE_VOLATILE(TREE_TYPE(ar));
+ return ar;
}
#endif
/* APPLE LOCAL end LLVM */
More information about the llvm-commits
mailing list