It appears that mudflap tries to run its test without optimization as well by doing
set MUDFLAP_FLAGS [list {} {-static} {-O2} {-O3}] but it does not consider options pre-pended on each commandline which includes -O2. So we happen to run the {-O2} test twice and the {} test is useless. Fixed by explicitely using {-O0} everywhere. I did not touch -static as it is sufficiently different (even if it includes -O2 as well). Committed as obvious. Richard. 2012-07-13 Richard Guenther <rguent...@suse.de> * testsuite/libmudflap.c++/ctors.exp: Explicitely specify -O0. * testsuite/libmudflap.c++/c++frags.exp: Likewise. * testsuite/libmudflap.cth/cthfrags.exp: Likewise. * testsuite/libmudflap.c/cfrags.exp: Likewise. * testsuite/libmudflap.c/externs.exp: Likewise. Index: libmudflap/testsuite/libmudflap.c++/ctors.exp =================================================================== --- libmudflap/testsuite/libmudflap.c++/ctors.exp (revision 189462) +++ libmudflap/testsuite/libmudflap.c++/ctors.exp (working copy) @@ -1,5 +1,5 @@ global MUDFLAP_FLAGS -set MUDFLAP_FLAGS [list {} {-static} {-O2} {-O3}] +set MUDFLAP_FLAGS [list {-O0} {-static} {-O2} {-O3}] libmudflap-init c++ if {$cxx == "g++"} then { Index: libmudflap/testsuite/libmudflap.c++/c++frags.exp =================================================================== --- libmudflap/testsuite/libmudflap.c++/c++frags.exp (revision 189462) +++ libmudflap/testsuite/libmudflap.c++/c++frags.exp (working copy) @@ -1,5 +1,5 @@ global MUDFLAP_FLAGS -set MUDFLAP_FLAGS [list {} {-static} { -O} {-O2} {-O3}] +set MUDFLAP_FLAGS [list {-O0} {-static} { -O} {-O2} {-O3}] libmudflap-init c++ if {$cxx == "g++"} then { Index: libmudflap/testsuite/libmudflap.cth/cthfrags.exp =================================================================== --- libmudflap/testsuite/libmudflap.cth/cthfrags.exp (revision 189462) +++ libmudflap/testsuite/libmudflap.cth/cthfrags.exp (working copy) @@ -1,5 +1,5 @@ global MUDFLAP_FLAGS -set MUDFLAP_FLAGS [list {} {-static -DSTATIC} {-O2} {-O3}] +set MUDFLAP_FLAGS [list {-O0} {-static -DSTATIC} {-O2} {-O3}] libmudflap-init c Index: libmudflap/testsuite/libmudflap.c/cfrags.exp =================================================================== --- libmudflap/testsuite/libmudflap.c/cfrags.exp (revision 189462) +++ libmudflap/testsuite/libmudflap.c/cfrags.exp (working copy) @@ -1,5 +1,5 @@ global MUDFLAP_FLAGS -set MUDFLAP_FLAGS [list {} {-static} {-O2} {-O3}] +set MUDFLAP_FLAGS [list {-O0} {-static} {-O2} {-O3}] libmudflap-init c Index: libmudflap/testsuite/libmudflap.c/externs.exp =================================================================== --- libmudflap/testsuite/libmudflap.c/externs.exp (revision 189462) +++ libmudflap/testsuite/libmudflap.c/externs.exp (working copy) @@ -1,5 +1,5 @@ global MUDFLAP_FLAGS -set MUDFLAP_FLAGS [list {} {-static} {-O2} {-O3}] +set MUDFLAP_FLAGS [list {-O0} {-static} {-O2} {-O3}] libmudflap-init c dg-init