Index: test/CodeGen/asm-inout.c
===================================================================
--- test/CodeGen/asm-inout.c	(revision 112002)
+++ test/CodeGen/asm-inout.c	(working copy)
@@ -17,3 +17,15 @@
   // CHECK: store i32 {{%[a-zA-Z0-9\.]+}}, i32* [[REGCALLRESULT]]
   asm ("foobar" : "+r"(*foo()));
 }
+
+// PR7338
+void test3(int *vout, int vin)
+{
+  // CHECK: call void asm "opr $0,$1", "=*r|m|r,r|m|r,~{di},~{dirflag},~{fpsr},~{flags}"
+asm(
+		"opr %[vout],%[vin]"
+		: [vout] "=r,=m,=r" (*vout)
+		: [vin] "r,m,r" (vin)
+		: "edi"
+		);
+}
Index: lib/Basic/TargetInfo.cpp
===================================================================
--- lib/Basic/TargetInfo.cpp	(revision 112002)
+++ lib/Basic/TargetInfo.cpp	(working copy)
@@ -291,9 +291,8 @@
       Info.setAllowsMemory();
       break;
     case ',': // multiple alternative constraint.  Pass it.
-      Name++;
       // Handle additional optional '=' or '+' modifiers.
-      if (*Name == '=' || *Name == '+')
+      if (Name[1] == '=' || Name[1] == '+')
         Name++;
       break;
     case '?': // Disparage slightly code.
Index: lib/CodeGen/CGStmt.cpp
===================================================================
--- lib/CodeGen/CGStmt.cpp	(revision 112002)
+++ lib/CodeGen/CGStmt.cpp	(working copy)
@@ -861,14 +861,11 @@
 SimplifyConstraint(const char *Constraint, const TargetInfo &Target,
                  llvm::SmallVectorImpl<TargetInfo::ConstraintInfo> *OutCons=0) {
   std::string Result;
-  std::string tmp;
 
   while (*Constraint) {
     switch (*Constraint) {
     default:
-      tmp = Target.convertConstraint(*Constraint);
-      if (Result.find(tmp) == std::string::npos) // Combine unique constraints
-        Result += tmp;
+      Result += Target.convertConstraint(*Constraint);
       break;
     // Ignore these
     case '*':
@@ -877,8 +874,8 @@
     case '=': // Will see this and the following in mult-alt constraints.
     case '+':
       break;
-    case ',':                 // FIXME - Until the back-end properly supports
-              return Result;  // multiple alternative constraints, we stop here.
+    case ',':
+      Result += "|";
       break;
     case 'g':
       Result += "imr";
