diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 314c2e4565af28b6267d65be31449627060ce29c..2245646bc1215a0b378d771d9f7ab09bb6678520 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2012-11-16  Uros Bizjak  <ubizjak@gmail.com>
+
+	* lib/gcc-dg.exp (cleanup-saved-temps): Add .mii to suffixes.
+	* gcc.dg/hoist-register-pressure-1.c: Cleanup hoist rtl dump.
+	* gcc.dg/hoist-register-pressure-2.c: Ditto.
+	* gcc.dg/hoist-register-pressure-3.c: Ditto.
+	* gcc.dg/tree-prof/peel-1.c: Cleanup loop2_unroll rtl dump.
+	* gcc.dg/tree-prof/unroll-1.c: Ditto.
+
 2012-11-16  Dodji Seketeli  <dodji@redhat.com>
 
 	PR c++/54875
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
index 01e5ed4fbb5312a8ff8852ccac33426176b8def9..f5b5302b3c5f028038ad4aab6b607cc39194f0d4 100644
--- a/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
+++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-1.c
@@ -1,5 +1,6 @@
 /* { dg-options "-Os -fdump-rtl-hoist" }  */
 /* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" { target { nonpic } } } } */
+/* { dg-final { cleanup-rtl-dump "hoist" } } */
 
 #define BUF 100
 int a[BUF];
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
index 7f973fec575d78894f387b14494e1c5cd8b8f5fc..30408f318c4d070de59bc61c504d8a725030f133 100644
--- a/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
+++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-2.c
@@ -1,5 +1,6 @@
 /* { dg-options "-Os -fdump-rtl-hoist" }  */
 /* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+/* { dg-final { cleanup-rtl-dump "hoist" } } */
 
 #define BUF 100
 int a[BUF];
diff --git a/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c b/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c
index bea8bd40110c8220a4a7c164cdbb97e50da75c36..b050f89823fa3685842d22d30e1398dd94ca9a8c 100644
--- a/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c
+++ b/gcc/testsuite/gcc.dg/hoist-register-pressure-3.c
@@ -1,5 +1,6 @@
 /* { dg-options "-Os -fdump-rtl-hoist" }  */
 /* { dg-final { scan-rtl-dump "PRE/HOIST: end of bb .* copying expression" "hoist" } } */
+/* { dg-final { cleanup-rtl-dump "hoist" } } */
 
 #define BUF 100
 int a[BUF];
diff --git a/gcc/testsuite/gcc.dg/tree-prof/peel-1.c b/gcc/testsuite/gcc.dg/tree-prof/peel-1.c
index baa601dc1ec8cb9ae70cab106037a9ab54cac704..65f0c562cd45c839cba68c2174e2e18bca6d4728 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/peel-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/peel-1.c
@@ -22,4 +22,4 @@ main()
 /* { dg-final-use { scan-rtl-dump "Considering simply peeling loop" "loop2_unroll" } } */
 /* In fact one peeling is enough; we however mispredict number of iterations of the loop
    at least until loop_ch is schedule ahead of profiling pass.  */
-/* { dg-final-use { cleanup-rtl-dump "Decided to simply peel the loop 2 times" } } */
+/* { dg-final-use { cleanup-rtl-dump "loop2_unroll" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c b/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c
index 0b6e2ea13a8ee56eb427713c2156c7d2a15e7e6c..0663b1286d0605da9dfab6b861b74bc44d174ec7 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/unroll-1.c
@@ -20,4 +20,4 @@ main()
   return 0;
 }
 /* { dg-final-use { scan-rtl-dump "Considering unrolling loop with constant number of iterations" "loop2_unroll" } } */
-/* { dg-final-use { cleanup-rtl-dump "Not unrolling loop, doesn't roll" } } */
+/* { dg-final-use { cleanup-rtl-dump "loop2_unroll" } } */
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index b3f8d3bb1855c85873e52e1f7075b758affbc571..c939c50a36c7162a431c7d8fab2971b1ad9e035c 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -549,7 +549,7 @@ proc cleanup-saved-temps { args } {
     set suffixes {}
 
     # add the to-be-kept suffixes
-    foreach suffix {".ii" ".i" ".s" ".o" ".gkd"} {
+    foreach suffix {".mii" ".ii" ".i" ".s" ".o" ".gkd"} {
 	if {[lsearch $args $suffix] < 0} {
 	    lappend suffixes $suffix
 	}