when merging two alias sets together, be sure to propagate the volatility of
[oota-llvm.git] / lib / Analysis / AliasSetTracker.cpp
index 7f976200086eee14e89c7b454b8ad2397da8eaec..0397af7e979fce11be064f15f8cb82d6bc21f05a 100644 (file)
@@ -351,9 +351,11 @@ void AliasSetTracker::add(const AliasSetTracker &AST) {
       // Loop over all of the pointers in this alias set...
       AliasSet::iterator I = AS.begin(), E = AS.end();
       bool X;
-      for (; I != E; ++I)
-        addPointer(I.getPointer(), I.getSize(),
-                   (AliasSet::AccessType)AS.AccessTy, X);
+      for (; I != E; ++I) {
+        AliasSet &NewAS = addPointer(I.getPointer(), I.getSize(),
+                                     (AliasSet::AccessType)AS.AccessTy, X);
+        if (AS.isVolatile()) NewAS.setVolatile();
+      }
     }
 }