From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0B2AD385C422 for ; Wed, 14 Feb 2024 14:10:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B2AD385C422 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0B2AD385C422 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707919819; cv=none; b=DBT0nqZIfY04hhkXl0XAQCDaO3W8KOjMOy7wMZGMqHdPhlZqX/jer1Gb5lsSpYq35heFiNJh+usgX4Vq/PHHVDvFR3ZSS94fm9YLuhgjiSy2w6pvb6k7gpWwkoQ0Ve4K4aK0PhOFGlhL7FzzI4GCAuE9SljYLk1OjeIPZWRdWA4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707919819; c=relaxed/simple; bh=HxFj9SgvQ7ymp387XZgZcefVME39QacdAr61WZiVFcM=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=FJPME2AZPTANk3d0Ym2XCl3o6lVL5LxJQUEVWsEGcnnd6ea2z1v+11MrtUS0xEsPJmW+z9Lci9K+COfnT6Ne3rFKq6o3VBGzFqLzKXX86L7WuL/x36ZNUE4n/ARaK91XGKH/lqhjscLK0ts8KjRHf670HcmBecKo/OmCWX6Tor0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707919817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XHLM20wxiWA+XK2av/3XyB2lTfgfWcccnRN3XfgIcgQ=; b=Pc5VcKTPKLrA/OA8PKVYtpXRqXfMBH7bnNbHZ5mhT5cQlsGQXnI7ottB4mrsGx+NNAbLdX o3+T/YzjQtKZDn+nFUmttlB7eQOfH0or6IAPwj9yd5pTXOycqvOPb7EZX/QtIX6v5/Aqbc oormszCEAi+p016+KrJksalo/TYkAWo= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529--ZZ_bBbfONiqXSopm5QpZA-1; Wed, 14 Feb 2024 09:10:16 -0500 X-MC-Unique: -ZZ_bBbfONiqXSopm5QpZA-1 Received: by mail-oo1-f70.google.com with SMTP id 006d021491bc7-598b4d37248so6231670eaf.1 for ; Wed, 14 Feb 2024 06:10:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707919815; x=1708524615; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=XHLM20wxiWA+XK2av/3XyB2lTfgfWcccnRN3XfgIcgQ=; b=IKn4xbj95tPIYwpFpplKc7MRhEx3zDXrKp4I1JKaDF58QcKSRAH8G3eGdCOsd5yb0s nSRUvnt5cebbNxKl7xX7TZNpyzoJlVBI+zEWWUFJsVghEGUSSFNoCjUx/sVYyWfQ/mR6 NanmExz+2EU7gG/wZrTWtkaPLNNSCbax4g6E9o0UtJagEhn8QtzVOnBqeJ384klrcDr0 5ipgbdz1MjaQBM2a6wm+TSUq4c1Nc0teSNrqmb7dvYPGn8T5eJNVpjGOI/YiOGc5scWy dlOl2w0DlSCiDLEyFE46DXHkDb/aUK9zLqT11UieJsy/Hi4OYkVz3rbx2Jzj+j1nudQE F0Vg== X-Gm-Message-State: AOJu0Yzdh5OWnkpbcyCL+Ag6/OOxQA0U9fWwjlndR7N+M9YVIXkm5Kzu 3+8x8YJzelutcnhO7fs68qaWvOXwoAlszDjBIQ+PFPKvKnIiy/a/YFCwFDXRd/8qFtVDvz4kz0w TfjNK3mYwHCzB5lO+kbZpYIrv9kLyN8XqhaZsXFV6GO+b X-Received: by 2002:a05:6359:410e:b0:176:d1ed:aedf with SMTP id kh14-20020a056359410e00b00176d1edaedfmr3056098rwc.0.1707919815380; Wed, 14 Feb 2024 06:10:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IH/NKpoX0Kr1uS8c/zNorC4LnLvHII53BS/dknqWFzM8r5z+MqQMWDpfY2sA9fn/zXHaTQvrA== X-Received: by 2002:a05:6359:410e:b0:176:d1ed:aedf with SMTP id kh14-20020a056359410e00b00176d1edaedfmr3056070rwc.0.1707919815091; Wed, 14 Feb 2024 06:10:15 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUIzfnwXvJfJHNVh26G044kAS9b/ftlAtFHsI1pbCsgC9tyP3+BYWmykKL1IPnYpYn7lca8B0hK1H959xuNzFElZA== Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id r5-20020ac87ee5000000b0042c58191861sm2028627qtc.53.2024.02.14.06.10.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 06:10:14 -0800 (PST) Message-ID: Subject: Re: New feature: -fdump-gimple-nodes (once more, with feeling) From: David Malcolm To: Andi Kleen , Robert Dubner Cc: 'GCC Mailing List' Date: Wed, 14 Feb 2024 09:10:14 -0500 In-Reply-To: <87v86rwl1c.fsf@linux.intel.com> References: <094e01da5eb5$4c598e40$e50caac0$@symas.com> <87v86rwl1c.fsf@linux.intel.com> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 2024-02-13 at 23:40 -0800, Andi Kleen via Gcc wrote: > Robert Dubner writes: >=20 > > There didn't seem to be any such functionality in GCC.=C2=A0 I found a > > routine > > in print-tree.cc which printed out a single node, but I needed to > > understand the entire tree of nodes for a function. >=20 > FWIW the standard way to do this is to run the compiler in gdb with > the .gdbinit in the object directory, set a suitable break > point and then use pt etc to dump the trees. It prints all the fields > and you can use the gdb command line to explore further. >=20 > > ***********************************This is NodeNumber0 > > (0x7f12e13b0d00) NodeNumber0 > > tree_code: function_decl > > tree_code_class: tcc_declaration >=20 > My suggestion if you go this route would be to generate > some standard format like YAML or JSON that other tools > can easily parse. I'd love it if we had a JSON output for our IR. FWIW, as of r14-6228- g3bd8241a1f1982 our JSON output routines can nicely format the generated JSON in a way that I find very readable in debugging (and I'm using this when debugging the analyzer). Dave