[LLVMbugs] Re: Can't build llvm-gcc at FreeBSD after last chages in llvm-gcc/gcc/llvm-types.c

Chris Lattner sabre at nondot.org
Sun Jul 18 14:21:31 PDT 2004


On Mon, 19 Jul 2004, Vladimir Merzliakov wrote:
> checking for BSD-compatible nm... nm
> checking how to recognise dependant libraries... Assertion failed: (0 &&
> "Unknown mode for pointer type!"), function llvm_type_get_size, file
> ../../src/llvm-gcc/gcc/llvm-types.c, line 67.
> <stdin>:0: internal compiler error: Abort trap
> Please submit a full bug report,

Better yet, please try this patch :)

===================================================================
RCS file: /home/vadve/shared/PublicCVS/llvm-gcc/gcc/llvm-types.c,v
retrieving revision 1.10
diff -u -r1.10 llvm-types.c
--- llvm-types.c        7 Jul 2004 03:13:44 -0000       1.10
+++ llvm-types.c        18 Jul 2004 21:07:10 -0000
@@ -60,13 +60,7 @@
   case ArrayTyID: return
llvm_type_get_size(Ty->Elements[0])*Ty->x.Array.Size;
   case StructTyID: return Ty->x.Struct.Size;
   case PointerTyID: /* Target dependant pointer size */
-    switch (ptr_mode) {
-    case SImode: case PSImode: return 4;
-    case DImode: case PDImode: return 8;
-    default:
-      assert(0 && "Unknown mode for pointer type!");
-    }
-    return (TREE_INT_CST_LOW(TYPE_SIZE(ptr_type_node))+7)/8;
+    return POINTER_SIZE/BITS_PER_UNIT;
   default:
     fprintf(stderr, "ERROR: Type doesn't have size: ");
     llvm_type_dump(Ty);


-Chris

-- 
http://llvm.cs.uiuc.edu/
http://nondot.org/sabre/




More information about the llvm-bugs mailing list