[llvm-commits] [llvm-gcc-4.2] r45181 - /llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Dale Johannesen dalej at apple.com
Tue Dec 18 14:01:38 PST 2007


Author: johannes
Date: Tue Dec 18 16:01:38 2007
New Revision: 45181

URL: http://llvm.org/viewvc/llvm-project?rev=45181&view=rev
Log:
Fix an ICE from testsuite.


Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-types.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-types.cpp?rev=45181&r1=45180&r2=45181&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-types.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-types.cpp Tue Dec 18 16:01:38 2007
@@ -301,8 +301,11 @@
           TREE_CODE(type) == POINTER_TYPE ||
           TREE_CODE(type) == REFERENCE_TYPE) && "not a sequential type!");
   // This relies on gcc types with constant size mapping to LLVM types with the
-  // same size.
-  return !VOID_TYPE_P(TREE_TYPE(type)) && isInt64(TYPE_SIZE(TREE_TYPE(type)), true);
+  // same size.  It is possible for the component type not to have a size:
+  // struct foo;  extern foo bar[];
+  return !VOID_TYPE_P(TREE_TYPE(type)) &&
+         (!TYPE_SIZE(TREE_TYPE(type)) || 
+            isInt64(TYPE_SIZE(TREE_TYPE(type)), true));
 }
 
 /// isArrayCompatible - Return true if the specified gcc array or pointer type





More information about the llvm-commits mailing list