Author: lattner Date: Wed Nov 28 16:44:01 2007 New Revision: 44419 URL: http://llvm.org/viewvc/llvm-project?rev=44419&view=rev Log: Fix PR1744 and test/CFrontend/2007-11-28-GlobalInitializer.c
Modified: llvm-gcc-4.0/trunk/gcc/tree.c Modified: llvm-gcc-4.0/trunk/gcc/tree.c URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/tree.c?rev=44419&r1=44418&r2=44419&view=diff ============================================================================== --- llvm-gcc-4.0/trunk/gcc/tree.c (original) +++ llvm-gcc-4.0/trunk/gcc/tree.c Wed Nov 28 16:44:01 2007 @@ -2492,6 +2492,22 @@ } else if (CONSTANT_CLASS_P (node)) ; +/* APPLE LOCAL begin LLVM */ +#ifdef ENABLE_LLVM + /* Support the "array ref with pointer base" extension. If we have &p[i], + treat this like we do a binop. + */ + else if (TREE_CODE(node) == ARRAY_REF && + POINTER_TYPE_P(TREE_TYPE(TREE_OPERAND(node, 0)))) { + ti &= TREE_INVARIANT(TREE_OPERAND(node, 0)) & + TREE_INVARIANT(TREE_OPERAND(node, 1)); + tc &= TREE_CONSTANT(TREE_OPERAND(node, 0)) & + TREE_CONSTANT(TREE_OPERAND(node, 1)); + se |= TREE_SIDE_EFFECTS(TREE_OPERAND(node, 0)) | + TREE_SIDE_EFFECTS(TREE_OPERAND(node, 1)); + } +#endif +/* APPLE LOCAL end LLVM */ else { ti = tc = false; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits