Revision: 123991
Author:   clattner
Date:     2007-02-16 17:43:38 -0800 (Fri, 16 Feb 2007)

Log Message:
-----------
Fix test/CFrontend/2007-02-16-VoidPtrDiff.c, a case where
llvm-gcc incorrectly rejected a GCC extension.

Modified Paths:
--------------
    apple-local/branches/llvm/gcc/c-common.c

Modified: apple-local/branches/llvm/gcc/c-common.c
===================================================================
--- apple-local/branches/llvm/gcc/c-common.c    2007-02-17 01:18:16 UTC (rev 
123990)
+++ apple-local/branches/llvm/gcc/c-common.c    2007-02-17 01:43:38 UTC (rev 
123991)
@@ -2414,6 +2414,11 @@
     folded = fold (result);
     if (folded == result)
       TREE_CONSTANT (folded) = TREE_CONSTANT (ptrop) & TREE_CONSTANT (intop);
+    
+    /* If the original was void* + int, we converted it to char* + int.  
Convert
+       back to the appropriate void* result.  */
+    if (!size_set)
+      folded = convert(result_type, folded);
     return folded;
   }
 #endif


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to