From patchwork Thu Apr 26 17:12:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 905261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-476860-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ZDpUOGC/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40X3Xx1CMMz9ryr for ; Fri, 27 Apr 2018 03:12:48 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=IMrLuFogvk9aqgUUCV94N6Rl9rOGE/nfWcNzO5CkiEWJZcyOtR yJkmQDgS7Jd+fM4kmiEU9AJzdkftn3CRjF7CQT0R6en921x+VfjrR7+DOmBOQCX/ hvVY3M4DlUmtVbuOW7HTcvrBfr3YyslaedAbrh2Bh4oCY9+FH61nSg3DM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:message-id:date:mime-version:content-type; s= default; bh=lN5ACTGuDLuGDMUsJlAvfNApoCw=; b=ZDpUOGC/dhl2iZn8/t80 wc8uodFykzcC8eMowsj85JTi+EMavLb2jWh04sQrDk2ANGxj8vyVKXKx8GYWzbOF myJSxpsuuilLlrcem6beV95byt5/rYQxpwiHfgzwPvVCwNefSfPcPmOeHp/+XmSD cIfCtCVFkxEE77hXmBH2klE= Received: (qmail 130827 invoked by alias); 26 Apr 2018 17:12:40 -0000 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 Received: (qmail 130818 invoked by uid 89); 26 Apr 2018 17:12:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=letters, Hx-languages-length:1975 X-HELO: mail-qk0-f177.google.com Received: from mail-qk0-f177.google.com (HELO mail-qk0-f177.google.com) (209.85.220.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Apr 2018 17:12:38 +0000 Received: by mail-qk0-f177.google.com with SMTP id x22so8348819qkb.12 for ; Thu, 26 Apr 2018 10:12:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:cc:from:subject:message-id:date :user-agent:mime-version:content-language; bh=/ABQkgJVOVGHVsSBxKX7WG4g+FpVbeZgPG5YZ6SBsn8=; b=a3QEQxPZ+VqqovCXiFt9gNQQq9BbUDh9VrXJkUPVMmIEE59cjyhngbs7PRp1p0nUwR RtAjYVB74U4+3URsQYesjqN/VeJWQCSG1zKHrF+sEYOAamefagfbOGV7lijs73rR7ByL S91JCcecc4aMgZ1RqI9pGA554jc3l3wVZlwCQcIdmbuNEF7GBN19yd0Uezg+OqG+qs9w rYRWw4eSItIh49L3Mm82P2C60wWCuevhDlBp2f3tHmIpZcpcYC9mPFr/Vtfb+Dj8awVr B/3qPLYEGAQOpbweKDCS7fb5jmyyegDNAugHdClWuWtycxOmqWOqoQXoy6QqPgUib05r aHeA== X-Gm-Message-State: ALQs6tC1iUVgrNpnYf2J//i6M/EDAGIWIp7zfpOwHSk1qxmJPNBu8xD4 YoK7RvVnBu9zSD8Yd07/jvg= X-Google-Smtp-Source: AB8JxZq4W+9xEtIUiO4odO73yVtop/DHctyUbke+kAwdvKZWBdwir1BbtY8B3UlSfL/PWEgMwEkRbA== X-Received: by 10.55.95.133 with SMTP id t127mr7627552qkb.186.1524762756374; Thu, 26 Apr 2018 10:12:36 -0700 (PDT) Received: from ?IPv6:2601:181:c480:b5c0::93f8? ([2601:181:c480:b5c0::93f8]) by smtp.googlemail.com with ESMTPSA id s19sm1274470qki.62.2018.04.26.10.12.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 10:12:35 -0700 (PDT) To: GCC Patches Cc: sandra@codesourcery.com, Richard Guenther From: Nathan Sidwell Subject: [patch] allow '-' for stdout dump Message-ID: Date: Thu, 26 Apr 2018 13:12:33 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Here's the patch to allow '-' as a synonym for 'stdout'. It's easier to type, and a convention used elsewhere. Also document the existing stdout/stderr selection along with the new behaviour? ok for trunk? nathan 2018-04-26 Nathan Sidwell * dumpfile.c (dump_open): Allow '-' for stdout. * doc/invoke.texi (fdump-rtl): Document stdin/stdout selection. Index: doc/invoke.texi =================================================================== --- doc/invoke.texi (revision 259680) +++ doc/invoke.texi (working copy) @@ -13368,9 +13368,10 @@ Says to make debugging dumps during comp @var{letters}. This is used for debugging the RTL-based passes of the compiler. The file names for most of the dumps are made by appending a pass number and a word to the @var{dumpname}, and the files are -created in the directory of the output file. In case of -@option{=@var{filename}} option, the dump is output on the given file -instead of the pass numbered dump files. Note that the pass number is +created in the directory of the output file. Using a +@option{=@var{filename}} suffix overrides this default scheme. You +can specify @code{stdout} or @code{-} to refer to standard output, and +@code{stderr} for standard error. Note that the pass number is assigned as passes are registered into the pass manager. Most passes are registered in the order that they will execute and for these passes the number corresponds to the pass execution order. However, passes Index: dumpfile.c =================================================================== --- dumpfile.c (revision 259681) +++ dumpfile.c (working copy) @@ -323,7 +323,8 @@ dump_open (const char *filename, bool tr if (strcmp ("stderr", filename) == 0) return stderr; - if (strcmp ("stdout", filename) == 0) + if (strcmp ("stdout", filename) == 0 + || strcmp ("-", filename) == 0) return stdout; FILE *stream = fopen (filename, trunc ? "w" : "a");