From patchwork Mon Nov 2 16:40:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1392375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=ON1X0QS5; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CPzDX5QfRz9sVM for ; Tue, 3 Nov 2020 03:40:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D731382D824; Mon, 2 Nov 2020 16:40:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by sourceware.org (Postfix) with ESMTPS id 5F65F3836C09 for ; Mon, 2 Nov 2020 16:40:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5F65F3836C09 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qk1-x72e.google.com with SMTP id b18so11999993qkc.9 for ; Mon, 02 Nov 2020 08:40:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=rQUYwiBzVJmWvv1uPg6bs4ddr7zL+ZVF+BfUZb7EVhU=; b=ON1X0QS5Ae0H3L8m1WyyXwEwUhgHHqdVDCjqSCvEpjpa4L/0cBRv8ALIo709LD+l+X y7NEEzJKuGEYnFTDG7Jzy4VeXj9N72kpAu74eQyKJ1khDoJBBSCIh7DpLBKfvzuALZeg WKFkrCQWeyPUt9jDN3ZhCsWSDM4sTU2ynxuCOoFQkUb7dvIBPcBeuLtTpGiUKwVNRiEU 1KqRQTtzjLcxZ0CPEl/EnEDxcDCImXpqTbZmy1LzETAu3Hk8FsAz69btKHtYRVon+sXp 1bZfbTsktWPvPNlkzfk54vzUsIgUXSWr1MvUc0nv47V/0C4WHHTnKbBjlpsNgXPIji2H ifRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=rQUYwiBzVJmWvv1uPg6bs4ddr7zL+ZVF+BfUZb7EVhU=; b=C5wuOiqkPZv7x78Hac2B6429apL8gHSkRZPnDLRgEH1+8DvhR6nbpRQZKwX8KJ8H2G zXTun1VEIrfdHMeRozrRPvWBtwCuSjKgIYA/dGzUATmeB5YDosZB19NTTzrmUqN4/VoP Zh7/hExUECFWRIkbbPb7OQWud+BAhZRUtrK1/+m04SoH+wMexIr4hZuWZI4b0907qLXu KBp09fEVeAOdEQwCQ15vMb/s/LUVLKbPFPT5/37FXpzDac1r0e54yoYI7imPuWMv2sQK P1zyYMHrNXr2w8nZLpUEh0+j2pnifU+4Tf5iwcQP7FquoILmxixVSHICynKrssexuMhE 9NOA== X-Gm-Message-State: AOAM533hzaq+ol8rX5OmNncH7K05oR00jEhh4XS8t/h+XmIZwtvRPj7e 6qoyOPXsfmbWb9cTYexZj3k= X-Google-Smtp-Source: ABdhPJy6NeulgQ018NEM90fP4EM42A1XbAyU9HZhxOhFesfy4icyY5MKv1bpMYEopUQYsWC3uybTTA== X-Received: by 2002:ae9:f402:: with SMTP id y2mr14994038qkl.459.1604335222835; Mon, 02 Nov 2020 08:40:22 -0800 (PST) Received: from ?IPv6:2620:10d:c0a8:1102:99fe:751e:9aea:5090? ([2620:10d:c091:480::1:7f20]) by smtp.googlemail.com with ESMTPSA id x191sm7802443qkb.53.2020.11.02.08.40.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Nov 2020 08:40:21 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: core: debug-print whole call expr Message-ID: <39303332-c0ba-8dc4-9a88-be134f6ba0cc@acm.org> Date: Mon, 2 Nov 2020 11:40:19 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" In debugging some call-expr handling, I got confused because the debug printer elided NULL call operands. This changes the printer to display them as NULL. gcc/ * print-tree.c (print_node): Display all the operands of a call expr. pushing to trunk diff --git i/gcc/print-tree.c w/gcc/print-tree.c index d1150e472d5..84bf8199b1e 100644 --- i/gcc/print-tree.c +++ w/gcc/print-tree.c @@ -742,20 +742,26 @@ print_node (FILE *file, const char *prefix, tree node, int indent, } if (code == CALL_EXPR) { - call_expr_arg_iterator iter; - tree arg; print_node (file, "fn", CALL_EXPR_FN (node), indent + 4); print_node (file, "static_chain", CALL_EXPR_STATIC_CHAIN (node), indent + 4); - i = 0; - FOR_EACH_CALL_EXPR_ARG (arg, iter, node) + + call_expr_arg_iterator iter; + init_call_expr_arg_iterator (node, &iter); + while (more_call_expr_args_p (&iter)) { /* Buffer big enough to format a 32-bit UINT_MAX into, plus the text. */ char temp[15]; - sprintf (temp, "arg:%u", i); - print_node (file, temp, arg, indent + 4); - i++; + sprintf (temp, "arg:%u", iter.i); + tree arg = next_call_expr_arg (&iter); + if (arg) + print_node (file, temp, arg, indent + 4); + else + { + indent_to (file, indent + 4); + fprintf (file, "%s NULL", temp); + } } } else