The constant merging pass has no qualms about merging constants with external linkage, which causes link errors later. It should only merge constants away that have internal linkage. This is tested as: test/Regression/Transforms/ConstantMerge/2003-10-28-MergeExternalConstants.ll This causes undefined symbols in libstdc++, specifically "std::ios_base::badbit".
This is now fixed: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20031027/008939.html