From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id 6E340389087D for ; Tue, 5 May 2020 23:06:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6E340389087D Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-145--aX4S1JEN92qyuQkoODMgg-1; Tue, 05 May 2020 19:06:14 -0400 X-MC-Unique: -aX4S1JEN92qyuQkoODMgg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8778E80183C; Tue, 5 May 2020 23:06:13 +0000 (UTC) Received: from ovpn-114-206.phx2.redhat.com (ovpn-114-206.phx2.redhat.com [10.3.114.206]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D39410021B3; Tue, 5 May 2020 23:06:13 +0000 (UTC) Message-ID: <786dd932f06faa247e7fd3717e2d0ee39fc23581.camel@redhat.com> Subject: Re: Access RTX register information From: Jeff Law Reply-To: law@redhat.com To: eashan gupta , gcc-help@gcc.gnu.org Date: Tue, 05 May 2020 17:06:12 -0600 In-Reply-To: References: Organization: Red Hat User-Agent: Evolution 3.36.1 (3.36.1-1.fc32) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.4 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_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-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2020 23:06:18 -0000 On Wed, 2020-05-06 at 04:27 +0530, eashan gupta via Gcc-help wrote: > Hi, > Is it possible to access the variable name if we have an RTX which is a reg > that corresponds to a variable declared by the user? > > I have found the macro REG_USERVAR_P (RTX) in rtl.h which returns the > boolean "1 if RTX is a reg that corresponds to a variable declared by the > user." But I am unable to get a suitable macro to get the variable name the > reg corresponds to. > > On dumping the rtl output using the command: > > print_rtl_single(stdout, in_rtx); > > I get output: > > (reg/v:SI 68 [ c ]) > > where "c" was the variable name defined by me. How do I access "c" given > the rtx statement, "in_rtx"? If/when this information is available it would be in the REG_EXPR field which would point back to the tree declaration. jeff