From patchwork Fri Jul 8 10:25:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 103805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 4AAF21007D1 for ; Fri, 8 Jul 2011 20:25:41 +1000 (EST) Received: (qmail 22860 invoked by alias); 8 Jul 2011 10:25:40 -0000 Received: (qmail 22813 invoked by uid 22791); 8 Jul 2011 10:25:39 -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; Fri, 08 Jul 2011 10:25:22 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 968E6907; Fri, 8 Jul 2011 12:25:20 +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 RWUiCvkBa7GH; Fri, 8 Jul 2011 12:25:18 +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 73259906; Fri, 8 Jul 2011 12:25:18 +0200 (CEST) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id p68APHJh004575; Fri, 8 Jul 2011 12:25:17 +0200 (MEST) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [testsuite] Fix g++.dg/opt/devirt2.C on 32-bit Solaris/SPARC with Sun as (PR testsuite/48727) Date: Fri, 08 Jul 2011 12:25:17 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org As described in the PR, unless the assembler supports -relax, SPARC gcc can emit sethi+jmp instead of just call, so the pattern has to be more specific. This patch implements this, also having to account for the fact that subexpressions in Tcl regexps double the match count. Tested with the appropriate runtest invocation on sparc-sun-solaris2.11 with both Sun and GNU as, both multilibs, and i386-pc-solaris2.10. Installed on mainline. Rainer 2011-07-08 Rainer Orth PR testsuite/48727 * g++.dg/opt/devirt2.C: Use specific pattern for sparc*-*-*. Index: gcc/testsuite/g++.dg/opt/devirt2.C =================================================================== --- gcc/testsuite/g++.dg/opt/devirt2.C (revision 176033) +++ gcc/testsuite/g++.dg/opt/devirt2.C (working copy) @@ -2,9 +2,14 @@ // { dg-options "-O2" } // The IA64 and HPPA compilers generate external declarations in addition // to the call so those scans need to be more specific. -// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { hppa*-*-* ia64*-*-hpux* } } } } } -// { dg-final { scan-assembler-times "br\[^\n\]*xyzzy" 2 { target ia64*-*-hpux* } } } -// { dg-final { scan-assembler-times "xyzzy\[^\n\]*,%r" 2 { target hppa*-*-* } } } +// { dg-final { scan-assembler-times "xyzzy" 2 { target { ! { hppa*-*-* ia64*-*-hpux* sparc*-*-* } } } } } +// { dg-final { scan-assembler-times "br\[^\n\]*xyzzy" 2 { target ia64*-*-hpux* } } } +// { dg-final { scan-assembler-times "xyzzy\[^\n\]*,%r" 2 { target hppa*-*-* } } } +// Unless the assembler supports -relax, the 32-bit SPARC compiler generates +// sethi/jmp instead of just call, so the scans need to be more specific. +// With subexpressions, Tcl regexp -inline -all returns both the complete +// match and the subexpressions, so double the count. +// { dg-final { scan-assembler-times "\(jmp|call\)\[^\n\]*xyzzy" 4 { target sparc*-*-* } } } struct S { S(); virtual void xyzzy(); }; struct R { int a; S s; R(); };