From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16152 invoked by alias); 6 Jun 2011 17:02:15 -0000 Received: (qmail 16135 invoked by uid 22791); 6 Jun 2011 17:02:14 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jun 2011 17:01:58 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 98A4FEDE; Mon, 6 Jun 2011 19:01:55 +0200 (CEST) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5lLwgo-Pyb5a; Mon, 6 Jun 2011 19:01:52 +0200 (CEST) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id A1D17EDD; Mon, 6 Jun 2011 19:01:52 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p56H1pQa003552; Mon, 6 Jun 2011 19:01:51 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Mike Stump , fortran@gcc.gnu.org Subject: [testsuite] Compile gfortran.dg/graphite/vect-pr40979.f90 with -msse2 on x86 (PR tree-optimization/48497) Date: Mon, 06 Jun 2011 17:02:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00432.txt.bz2 As described in the PR, gfortran.dg/graphite/vect-pr40979.f90 FAILs on Solaris 8 and 9/x86, which defaults to -march=pentiumpro: FAIL: gfortran.dg/graphite/vect-pr40979.f90 -O scan-tree-dump-times vect "vectorized 1 loops" 1 The dump contains 'vectorized 0 loops' instead. The test passes with -march=pentium4 and also with -msse2. Since the test is compiled with a long bunch of options, it seemed inappropriate to use dg-options and repeat that list, just to add -msse2. Instead, I've chosen to implement dg-additional-options, which unlike dg-options just adds to the list of default options. I've missed this facility myself many times, and it seems like a straightforward addition. Bootstrapped without regressions on i386-pc-solaris2.8 and i386-pc-solaris2.11, will commit to mainline in a day or two unless someone objects. Rainer 2011-05-29 Rainer Orth gcc: PR tree-optimization/48497 * doc/sourcebuild.texi (Directives, dg-additional-options): Document. gcc/testsuite: PR tree-optimization/48497 * lib/gcc-defs.exp (dg-additional-options): New proc. * gfortran.dg/graphite/vect-pr40979.f90: Use dg-additional-options -msse2 on 32-bit x86. diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1016,6 +1016,11 @@ This directive does nothing on targets t default, or that don't provide them at all. It must come after all @code{dg-options} directives. For supported values of @var{feature} see @ref{Add Options, ,}. + +@item @{ dg-additional-options @var{options} [@{ target @var{selector} @}] @} +This directive provides a list of compiler options, to be used +if the target system matches @var{selector}, that are added to the default +options used for this set of tests. @end table @subsubsection Modify the test timeout value diff --git a/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 b/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 --- a/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 +++ b/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 @@ -1,5 +1,6 @@ ! { dg-do compile } ! { dg-require-effective-target vect_double } +! { dg-additional-options "-msse2" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } module mqc_m integer, parameter, private :: longreal = selected_real_kind(15,90) diff --git a/gcc/testsuite/lib/gcc-defs.exp b/gcc/testsuite/lib/gcc-defs.exp --- a/gcc/testsuite/lib/gcc-defs.exp +++ b/gcc/testsuite/lib/gcc-defs.exp @@ -183,6 +183,28 @@ if { [info procs runtest_file_p] == "" } } } +# Like dg-options, but adds to the default options rather than replacing them. + +proc dg-additional-options { args } { + upvar dg-extra-tool-flags extra-tool-flags + + if { [llength $args] > 3 } { + error "[lindex $args 0]: too many arguments" + return + } + + if { [llength $args] >= 3 } { + switch [dg-process-target [lindex $args 2]] { + "S" { eval lappend extra-tool-flags [lindex $args 1] } + "N" { } + "F" { error "[lindex $args 0]: `xfail' not allowed here" } + "P" { error "[lindex $args 0]: `xfail' not allowed here" } + } + } else { + eval lappend extra-tool-flags [lindex $args 1] + } +} + # Record additional sources files that must be compiled along with the # main source file. -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University