Index: test/CodeGen/string-literal.c
===================================================================
--- test/CodeGen/string-literal.c	(revision 136764)
+++ test/CodeGen/string-literal.c	(working copy)
@@ -14,26 +14,26 @@
   // CHECK-CPP0X: internal unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1
   char b[10] = "\u1120\u0220\U00102030";
 
-  // CHECK-C: private unnamed_addr constant [12 x i8] c"A\00\00\00B\00\00\00\00\00\00\00", align 1
-  // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"A\00\00\00B\00\00\00\00\00\00\00", align 1
+  // CHECK-C: private unnamed_addr constant [12 x i8] c"A\00\00\00B\00\00\00\00\00\00\00", align 4
+  // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"A\00\00\00B\00\00\00\00\00\00\00", align 4
   const wchar_t *foo = L"AB";
 
-  // CHECK-C: private unnamed_addr constant [12 x i8] c"4\12\00\00\0B\F0\10\00\00\00\00\00", align 1
-  // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"4\12\00\00\0B\F0\10\00\00\00\00\00", align 1
+  // CHECK-C: private unnamed_addr constant [12 x i8] c"4\12\00\00\0B\F0\10\00\00\00\00\00", align 4
+  // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"4\12\00\00\0B\F0\10\00\00\00\00\00", align 4
   const wchar_t *bar = L"\u1234\U0010F00B";
 
 #if __cplusplus >= 201103L
-  // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"C\00\00\00D\00\00\00\00\00\00\00", align 1
+  // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"C\00\00\00D\00\00\00\00\00\00\00", align 4
   const char32_t *c = U"CD";
 
-  // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"5\12\00\00\0C\F0\10\00\00\00\00\00", align 1
+  // CHECK-CPP0X: private unnamed_addr constant [12 x i8] c"5\12\00\00\0C\F0\10\00\00\00\00\00", align 4
   const char32_t *d = U"\u1235\U0010F00C";
 
-  // CHECK-CPP0X: private unnamed_addr constant [6 x i8] c"E\00F\00\00\00", align 1
+  // CHECK-CPP0X: private unnamed_addr constant [6 x i8] c"E\00F\00\00\00", align 2
   const char16_t *e = u"EF";
 
   // This should convert to utf16.
-  // CHECK-CPP0X: private unnamed_addr constant [10 x i8] c" \11 \02\C8\DB0\DC\00\00", align 1
+  // CHECK-CPP0X: private unnamed_addr constant [10 x i8] c" \11 \02\C8\DB0\DC\00\00", align 2
   const char16_t *f = u"\u1120\u0220\U00102030";
 
   // CHECK-CPP0X: private unnamed_addr constant [4 x i8] c"def\00", align 1
Index: lib/CodeGen/CGObjCGNU.cpp
===================================================================
--- lib/CodeGen/CGObjCGNU.cpp	(revision 136764)
+++ lib/CodeGen/CGObjCGNU.cpp	(working copy)
@@ -169,7 +169,8 @@
   /// where the C code specifies const char*.  
   llvm::Constant *MakeConstantString(const std::string &Str,
                                      const std::string &Name="") {
-    llvm::Constant *ConstStr = CGM.GetAddrOfConstantCString(Str, Name.c_str());
+    llvm::Constant *ConstStr =
+      CGM.GetAddrOfConstantCString(Str, 1, Name.c_str());
     return llvm::ConstantExpr::getGetElementPtr(ConstStr, Zeros);
   }
   /// Emits a linkonce_odr string, whose name is the prefix followed by the
@@ -780,7 +781,7 @@
 llvm::Value *CGObjCGNU::GetClassNamed(CGBuilderTy &Builder,
                                       const std::string &Name,
                                       bool isWeak) {
-  llvm::Value *ClassName = CGM.GetAddrOfConstantCString(Name);
+  llvm::Value *ClassName = CGM.GetAddrOfConstantCString(Name, 1);
   // With the incompatible ABI, this will need to be replaced with a direct
   // reference to the class symbol.  For the compatible nonfragile ABI we are
   // still performing this lookup at run time but emitting the symbol for the
Index: lib/CodeGen/CGExprConstant.cpp
===================================================================
--- lib/CodeGen/CGExprConstant.cpp	(revision 136764)
+++ lib/CodeGen/CGExprConstant.cpp	(working copy)
@@ -888,10 +888,10 @@
         LValue Res = CGF->EmitPredefinedLValue(cast<PredefinedExpr>(E));
         return cast<llvm::Constant>(Res.getAddress());
       } else if (Type == PredefinedExpr::PrettyFunction) {
-        return CGM.GetAddrOfConstantCString("top level", ".tmp");
+        return CGM.GetAddrOfConstantCString("top level", 1, ".tmp");
       }
 
-      return CGM.GetAddrOfConstantCString("", ".tmp");
+      return CGM.GetAddrOfConstantCString("", 1, ".tmp");
     }
     case Expr::AddrLabelExprClass: {
       assert(CGF && "Invalid address of label expression outside function.");
Index: lib/CodeGen/CodeGenModule.h
===================================================================
--- lib/CodeGen/CodeGenModule.h	(revision 136764)
+++ lib/CodeGen/CodeGenModule.h	(working copy)
@@ -545,6 +545,7 @@
   /// \param GlobalName If provided, the name to use for the global
   /// (if one is created).
   llvm::Constant *GetAddrOfConstantString(StringRef Str,
+                                          unsigned Alignment,
                                           const char *GlobalName=0);
 
   /// GetAddrOfConstantCString - Returns a pointer to a character array
@@ -554,6 +555,7 @@
   /// \param GlobalName If provided, the name to use for the global (if one is
   /// created).
   llvm::Constant *GetAddrOfConstantCString(const std::string &str,
+                                           unsigned Alignment,
                                            const char *GlobalName=0);
   
   /// GetAddrOfCXXConstructor - Return the address of the constructor of the
Index: lib/CodeGen/CGExpr.cpp
===================================================================
--- lib/CodeGen/CGExpr.cpp	(revision 136764)
+++ lib/CodeGen/CGExpr.cpp	(working copy)
@@ -1501,7 +1501,7 @@
          : PredefinedExpr::ComputeName((PredefinedExpr::IdentType)Type, CurDecl));
 
     llvm::Constant *C =
-      CGM.GetAddrOfConstantCString(FunctionName, GlobalVarName.c_str());
+      CGM.GetAddrOfConstantCString(FunctionName, 1, GlobalVarName.c_str());
     return MakeAddrLValue(C, E->getType());
   }
   }
Index: lib/CodeGen/CodeGenModule.cpp
===================================================================
--- lib/CodeGen/CodeGenModule.cpp	(revision 136764)
+++ lib/CodeGen/CodeGenModule.cpp	(working copy)
@@ -1923,7 +1923,10 @@
 CodeGenModule::GetAddrOfConstantStringFromLiteral(const StringLiteral *S) {
   // FIXME: This can be more efficient.
   // FIXME: We shouldn't need to bitcast the constant in the wide string case.
-  llvm::Constant *C = GetAddrOfConstantString(GetStringForStringLiteral(S));
+  CharUnits Align = getContext().getTypeAlignInChars(S->getType());
+  llvm::Constant *C = GetAddrOfConstantString(GetStringForStringLiteral(S),
+                                              Align.getQuantity(),
+                                              /* GlobalName */ 0);
   if (S->isWide() || S->isUTF16() || S->isUTF32()) {
     llvm::Type *DestTy =
         llvm::PointerType::getUnqual(getTypes().ConvertType(S->getType()));
@@ -1939,7 +1942,7 @@
   std::string Str;
   getContext().getObjCEncodingForType(E->getEncodedType(), Str);
 
-  return GetAddrOfConstantCString(Str);
+  return GetAddrOfConstantCString(Str, 1);
 }
 
 
@@ -1947,7 +1950,8 @@
 static llvm::Constant *GenerateStringLiteral(StringRef str,
                                              bool constant,
                                              CodeGenModule &CGM,
-                                             const char *GlobalName) {
+                                             const char *GlobalName,
+                                             unsigned Alignment) {
   // Create Constant for this string literal. Don't add a '\0'.
   llvm::Constant *C =
       llvm::ConstantArray::get(CGM.getLLVMContext(), str, false);
@@ -1957,7 +1961,7 @@
     new llvm::GlobalVariable(CGM.getModule(), C->getType(), constant,
                              llvm::GlobalValue::PrivateLinkage,
                              C, GlobalName);
-  GV->setAlignment(1);
+  GV->setAlignment(Alignment);
   GV->setUnnamedAddr(true);
   return GV;
 }
@@ -1971,6 +1975,7 @@
 ///
 /// The result has pointer to array type.
 llvm::Constant *CodeGenModule::GetAddrOfConstantString(StringRef Str,
+                                                       unsigned Alignment,
                                                        const char *GlobalName) {
   bool IsConstant = !Features.WritableStrings;
 
@@ -1980,16 +1985,22 @@
 
   // Don't share any string literals if strings aren't constant.
   if (!IsConstant)
-    return GenerateStringLiteral(Str, false, *this, GlobalName);
+    return GenerateStringLiteral(Str, false, *this, GlobalName, Alignment);
 
   llvm::StringMapEntry<llvm::Constant *> &Entry =
     ConstantStringMap.GetOrCreateValue(Str);
 
-  if (Entry.getValue())
-    return Entry.getValue();
+  if (llvm::Constant *C = Entry.getValue()) {
+    if (llvm::GlobalVariable *GV = dyn_cast<llvm::GlobalVariable>(C)) {
+      if (Alignment > GV->getAlignment()) {
+        GV->setAlignment(Alignment);
+      }
+    }
+    return C;
+  }
 
   // Create a global variable for this.
-  llvm::Constant *C = GenerateStringLiteral(Str, true, *this, GlobalName);
+  llvm::Constant *C = GenerateStringLiteral(Str, true, *this, GlobalName, Alignment);
   Entry.setValue(C);
   return C;
 }
@@ -1998,9 +2009,10 @@
 /// array containing the literal and a terminating '\0'
 /// character. The result has pointer to array type.
 llvm::Constant *CodeGenModule::GetAddrOfConstantCString(const std::string &Str,
+                                                        unsigned Alignment,
                                                         const char *GlobalName){
   StringRef StrWithNull(Str.c_str(), Str.size() + 1);
-  return GetAddrOfConstantString(StrWithNull, GlobalName);
+  return GetAddrOfConstantString(StrWithNull, Alignment, GlobalName);
 }
 
 /// EmitObjCPropertyImplementations - Emit information for synthesized
Index: lib/CodeGen/CGBlocks.cpp
===================================================================
--- lib/CodeGen/CGBlocks.cpp	(revision 136764)
+++ lib/CodeGen/CGBlocks.cpp	(working copy)
@@ -87,7 +87,7 @@
   std::string typeAtEncoding =
     CGM.getContext().getObjCEncodingForBlock(blockInfo.getBlockExpr());
   elements.push_back(llvm::ConstantExpr::getBitCast(
-                          CGM.GetAddrOfConstantCString(typeAtEncoding), i8p));
+                          CGM.GetAddrOfConstantCString(typeAtEncoding, 1), i8p));
   
   // GC layout.
   if (C.getLangOptions().ObjC1)
