[llvm-commits] [llvm-gcc-4.2] r118368 - /llvm-gcc-4.2/trunk/gcc/c-typeck.c
Dale Johannesen
dalej at apple.com
Sat Nov 6 21:56:41 PDT 2010
Author: johannes
Date: Sat Nov 6 23:56:41 2010
New Revision: 118368
URL: http://llvm.org/viewvc/llvm-project?rev=118368&view=rev
Log:
Apply the "outwit the common [albeit wrong] implementation
of offsetof" hack only if a constant is being derefenced.
Doing it for more cases did not mix well with LLVM's
representation of some pointer derefs as array accesses.
8629268. See testcase in llvm/test, coming.
Modified:
llvm-gcc-4.2/trunk/gcc/c-typeck.c
Modified: llvm-gcc-4.2/trunk/gcc/c-typeck.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/c-typeck.c?rev=118368&r1=118367&r2=118368&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/c-typeck.c (original)
+++ llvm-gcc-4.2/trunk/gcc/c-typeck.c Sat Nov 6 23:56:41 2010
@@ -3418,7 +3418,8 @@
when we have proper support for integer constant expressions. */
val = get_base_address (arg);
if (val && TREE_CODE (val) == INDIRECT_REF
- && TREE_CONSTANT (TREE_OPERAND (val, 0)))
+ /* LLVM LOCAL treat only constant deref as pseudo-offsetof 8629268 */
+ && TREE_CODE (TREE_OPERAND (val, 0)) == INTEGER_CST)
{
tree op0 = fold_convert (argtype, fold_offsetof (arg, val)), op1;
More information about the llvm-commits
mailing list