Index: gcc.dg/vect/vect.exp =================================================================== --- gcc.dg/vect/vect.exp (revision 133085) +++ gcc.dg/vect/vect.exp (working copy) @@ -1,4 +1,4 @@ -# Copyright (C) 1997, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 1997, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -63,7 +63,11 @@ set dg-do-what-default run } elseif { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } { lappend DEFAULT_VECTCFLAGS "-msse2" - set dg-do-what-default run + if [check_sse2_hw_available] { + set dg-do-what-default run + } else { + set dg-do-what-default compile + } } elseif { [istarget "mips*-*-*"] && [check_effective_target_mpaired_single] && [check_effective_target_nomips16] } { Index: lib/target-supports.exp =================================================================== --- lib/target-supports.exp (revision 133085) +++ lib/target-supports.exp (working copy) @@ -1,4 +1,4 @@ -# Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007 +# Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify @@ -1194,6 +1194,20 @@ } "-mfpu=neon -mfloat-abi=softfp"] } +# Return 1 if the target supports executing MMX instructions, 0 +# otherwise. Cache the result. + +proc check_sse2_hw_available { } { + return [check_runtime x86_sse2_hw_available { + int + main (void) + { + asm volatile ("paddq %xmm0,%xmm0"); + return 0; + } + } "-msse2"] +} + # Return 1 if this is a PowerPC target with floating-point registers. proc check_effective_target_powerpc_fprs { } {