Index: test/CodeGen/function-attributes.c
===================================================================
--- test/CodeGen/function-attributes.c	(revision 95872)
+++ test/CodeGen/function-attributes.c	(working copy)
@@ -81,3 +81,11 @@
 // CHECK: {
 void f15(void) {
 }
+
+// PR5254
+// CHECK: define void @f16
+// CHECK: alignstack(16)
+// CHECK: {
+void __attribute__((force_align_arg_pointer)) f16(void) {
+}
+
Index: lib/CodeGen/CodeGenFunction.cpp
===================================================================
--- lib/CodeGen/CodeGenFunction.cpp	(revision 95872)
+++ lib/CodeGen/CodeGenFunction.cpp	(working copy)
@@ -171,9 +171,9 @@
   CurFn = Fn;
   assert(CurFn->isDeclaration() && "Function already has body?");
 
-  // Pass inline keyword to optimizer if it appears explicitly on any
-  // declaration.
-  if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D))
+  if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) {
+    // Pass inline keyword to optimizer if it appears explicitly on any
+    // declaration.
     for (FunctionDecl::redecl_iterator RI = FD->redecls_begin(),
            RE = FD->redecls_end(); RI != RE; ++RI)
       if (RI->isInlineSpecified()) {
@@ -181,6 +181,16 @@
         break;
       }
 
+    // Pass force_align_arg_pointer to backend if it appears explicitly
+    // on any declaration.
+    for (FunctionDecl::redecl_iterator RI = FD->redecls_begin(),
+           RE = FD->redecls_end(); RI != RE; ++RI)
+      if (RI->hasAttr<X86ForceAlignArgPointerAttr>()) {
+        Fn->addFnAttr(llvm::Attribute::constructStackAlignmentFromInt(16));
+        break;
+      }
+  }
+
   llvm::BasicBlock *EntryBB = createBasicBlock("entry", CurFn);
 
   // Create a marker to make it easy to insert allocas into the entryblock
