From patchwork Mon Nov 4 19:45:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 1189135 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=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512354-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="i9n/Mw7k"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="G3+uto5U"; 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 476NZW3Jcdz9sP3 for ; Tue, 5 Nov 2019 06:45:55 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=WVhZ/OUXlbjCF4d+Kj1rTOoxadbsuwM6BzsWpp7AaZkAz/Wzvg j0G1jim+lpQB5s++kCtx20nxgTHP7c2kOG5G099MvuOSm+bYtcqFRzwmyNvCGKYf PpFl6LeY1VYNRJO/8+8sssgBStmu/IzMOeU/fTvBYiEeLuv98MarAOq3c= 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 :from:subject:message-id:date:mime-version:content-type; s= default; bh=kvrX006dctev3M04UY2+2q0/P6g=; b=i9n/Mw7kjeBWtHD3mal7 +6969xcy0EZj0OtYrxm8bEm1p29/nygwHp5z0fTDNLxR07Uuq7YMvxJxGP+5xCWZ ZLBAZy2IO8EKLzME91SoEVOcM2JiuMlo0zxBmKFtnuZH7Ie5urG5MhBsRNquqicf T4qSUopgouItiSOSLagRsY4= Received: (qmail 9600 invoked by alias); 4 Nov 2019 19:45:48 -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 9577 invoked by uid 89); 4 Nov 2019 19:45:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=H*Ad:U*aldyh, H*F:U*aldyh, HX-Languages-Length:2026 X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 04 Nov 2019 19:45:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1572896745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=iVBIO0f80a6eFQe8VkIy2V0IIAar5XwZa6R1XljJpYk=; b=G3+uto5UgE/WVeeswzAwP92RUMbpIuehqoQ0AfLBJvma1fu1/NEaiRg0PQbMQ4hhnV0eXx pAecVXsGlYsKfHw2pXWTL99ohEWcH3CEPA5G3N5KMb+ArG8R0zwtY2dnhhFFvJY4XID1ml TnWi945ugfow4oPc63VsBK/kM5sUTBc= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-202-_vd3ly9KMYG4WQZAp4aQ-Q-1; Mon, 04 Nov 2019 14:45:43 -0500 Received: by mail-wm1-f72.google.com with SMTP id t203so6646402wmt.7 for ; Mon, 04 Nov 2019 11:45:42 -0800 (PST) Received: from abulafia.quesejoda.com (149.red-81-32-135.dynamicip.rima-tde.net. [81.32.135.149]) by smtp.gmail.com with ESMTPSA id s13sm16932364wmc.28.2019.11.04.11.45.40 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Nov 2019 11:45:40 -0800 (PST) To: gcc-patches From: Aldy Hernandez Subject: [committed] add debugging routines for assert_info structure Message-ID: <1530d289-2f0a-de0e-96c9-aefffc4ca873@redhat.com> Date: Mon, 4 Nov 2019 20:45:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-IsSubscribed: yes We have a way of dumping the asserts in the asserts_for on-the-side structure, but we have no way of dumping the assert_info structure that evrp uses. Being able to dump these are quite useful in debugging. Committed as obvious. commit 9244efff3f7ccce390c70c83d9fc46cef6152bb4 Author: Aldy Hernandez Date: Mon Nov 4 12:14:56 2019 +0100 Implement debugging functions for assert_info's. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f29939a0dd8..d00348891bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-04 Aldy Hernandez + + * tree-vrp.c (dump_assert_info): New. + (dump_asserts_info): New. + 2019-11-04 Tamar Christina * tree-vect-slp.c (vectorize_slp_instance_root_stmt): Initialize rstmt. diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index da6b6151b4a..7c35802dacc 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -2114,6 +2114,45 @@ debug_all_asserts (void) dump_all_asserts (stderr); } +/* Dump assert_info structure. */ + +void +dump_assert_info (FILE *file, const assert_info &assert) +{ + fprintf (file, "Assert for: "); + print_generic_expr (file, assert.name); + fprintf (file, "\n\tPREDICATE: expr=["); + print_generic_expr (file, assert.expr); + fprintf (file, "] %s ", get_tree_code_name (assert.comp_code)); + fprintf (file, "val=["); + print_generic_expr (file, assert.val); + fprintf (file, "]\n\n"); +} + +DEBUG_FUNCTION void +debug (const assert_info &assert) +{ + dump_assert_info (stderr, assert); +} + +/* Dump a vector of assert_info's. */ + +void +dump_asserts_info (FILE *file, const vec &asserts) +{ + for (unsigned i = 0; i < asserts.length (); ++i) + { + dump_assert_info (file, asserts[i]); + fprintf (file, "\n"); + } +} + +DEBUG_FUNCTION void +debug (const vec &asserts) +{ + dump_asserts_info (stderr, asserts); +} + /* Push the assert info for NAME, EXPR, COMP_CODE and VAL to ASSERTS. */ static void