On Feb 18, 2007, at 12:03 AM, Reid Spencer wrote: > Hi, > > I found a situation where the following patch is needed. Building > llvm-gcc head (with cummulative patch) fails with SEGV while compiling > the libstdc++. This patch is a bandaid and I don't know if its the > correct thing or not as TYPE_SIZE(Type) should probably not be > null, but > it is. > > You can probably replicate this by doing a clean llvm-gcc build > including the latest patches.
Very strange, maybe it just hasn't hit the mirror yet, but mainline already has that: bool isPassedByInvisibleReference(tree Type) { // FIXME: Search for TREE_ADDRESSABLE in calls.c, and see if there are other // cases that make arguments automatically passed in by reference. return TREE_ADDRESSABLE(Type) || TREE_CODE(TYPE_SIZE(Type)) != INTEGER_CST; } -Chris > Reid. > > Index: llvm-types.cpp > =================================================================== > --- llvm-types.cpp (revision 276) > +++ llvm-types.cpp (working copy) > @@ -58,7 +58,7 @@ > // refined and replaced by another LLVM Type. This is achieved by > maintaining > // a map. > > -// Collection of LLVM Types and their names > +// Collection of LLVM Types > static std::vector<const Type *> LTypes; > typedef DenseMap<const Type *, unsigned> LTypesMapTy; > static LTypesMapTy LTypesMap; > @@ -212,7 +212,8 @@ > bool isPassedByInvisibleReference(tree Type) { > // FIXME: Search for TREE_ADDRESSABLE in calls.c, and see if there > are other > // cases that make arguments automatically passed in by reference. > - return TREE_ADDRESSABLE(Type); > + return TREE_ADDRESSABLE(Type) || > + (TYPE_SIZE(Type) && TREE_CODE(TYPE_SIZE(Type)) != > INTEGER_CST); > } > > /// GetTypeName - Return a fully qualified (with namespace prefixes) > name for > > > _______________________________________________ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits