From patchwork Sat Nov 5 10:44:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 123833 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 9F47EB7105 for ; Sat, 5 Nov 2011 21:46:18 +1100 (EST) Received: (qmail 15168 invoked by alias); 5 Nov 2011 10:46:16 -0000 Received: (qmail 15157 invoked by uid 22791); 5 Nov 2011 10:46:15 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,TW_CP X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 05 Nov 2011 10:46:02 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id DABBBCB0223; Sat, 5 Nov 2011 11:46:03 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 71jXQagV9Wwk; Sat, 5 Nov 2011 11:45:54 +0100 (CET) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id EA62FCB036D; Sat, 5 Nov 2011 11:45:30 +0100 (CET) From: Eric Botcazou To: Jakub Jelinek Subject: Re: [PATCH] strlenopt improvements Date: Sat, 5 Nov 2011 11:44:27 +0100 User-Agent: KMail/1.9.9 Cc: gcc-patches@gcc.gnu.org, Andreas Krebbel References: <20111024171514.GA3187@bart> <201111021341.31086.ebotcazou@adacore.com> <20111102124907.GQ1052@tyan-ft48-01.lab.bos.redhat.com> In-Reply-To: <20111102124907.GQ1052@tyan-ft48-01.lab.bos.redhat.com> MIME-Version: 1.0 Message-Id: <201111051144.28263.ebotcazou@adacore.com> 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 > The man page is outdated, stpcpy is a standard POSIX2008 function. Sorry for being so 20th century-ish. :-) > Anyway, in the other gcc.dg/strlenopt-* testcases for USE_GNU I was using > the convention that the name ended with g (i.e. strlenopt-22g.c) and > the test would start with: > /* This test needs runtime that provides stpcpy function. */ > /* { dg-do run { target *-*-linux* } } */ > instead of just > /* { dg-do run } */ Thanks for the tip. Tested on Solaris 8 and Linux, applied on the mainline. 2011-11-05 Eric Botcazou * gcc.dg/strlenopt-22g.c: New wrapper around... * gcc.dg/strlenopt-22.c: ...this. Do not define USE_GNU and adjust. Index: gcc.dg/strlenopt-22g.c =================================================================== --- gcc.dg/strlenopt-22g.c (revision 0) +++ gcc.dg/strlenopt-22g.c (revision 0) @@ -0,0 +1,14 @@ +/* This test needs runtime that provides stpcpy function. */ +/* { dg-do run { target *-*-linux* } } */ +/* { dg-options "-O2 -fdump-tree-strlen" } */ + +#define USE_GNU +#include "strlenopt-22.c" + +/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */ +/* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */ +/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */ +/* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */ +/* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */ +/* { dg-final { scan-tree-dump-times "stpcpy \\(" 1 "strlen" } } */ +/* { dg-final { cleanup-tree-dump "strlen" } } */ Index: gcc.dg/strlenopt-22.c =================================================================== --- gcc.dg/strlenopt-22.c (revision 181007) +++ gcc.dg/strlenopt-22.c (working copy) @@ -1,7 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -fdump-tree-strlen" } */ -#define USE_GNU #include "strlenopt.h" __attribute__((noinline, noclone)) size_t @@ -32,10 +31,9 @@ main () return 0; } -/* { dg-final { scan-tree-dump-times "strlen \\(" 0 "strlen" } } */ +/* { dg-final { scan-tree-dump-times "strlen \\(" 3 "strlen" } } */ /* { dg-final { scan-tree-dump-times "memcpy \\(" 1 "strlen" } } */ -/* { dg-final { scan-tree-dump-times "strcpy \\(" 0 "strlen" } } */ +/* { dg-final { scan-tree-dump-times "strcpy \\(" 1 "strlen" } } */ /* { dg-final { scan-tree-dump-times "strcat \\(" 0 "strlen" } } */ /* { dg-final { scan-tree-dump-times "strchr \\(" 1 "strlen" } } */ -/* { dg-final { scan-tree-dump-times "stpcpy \\(" 1 "strlen" } } */ /* { dg-final { cleanup-tree-dump "strlen" } } */