From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id 92B7B395B040 for ; Thu, 7 May 2020 12:51:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 92B7B395B040 Received: by mail-qk1-x730.google.com with SMTP id f13so5809274qkh.2 for ; Thu, 07 May 2020 05:51:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cCufzwd5t0c0NL/1jObfmS1UAVITSy0tayGH/dT+mMM=; b=JFUXNFsLTrSt32tiJp5+d7YliycVxyX0bJa34oMr5z+ZJk3KbtJBlWGxK88tJG+QaW 18lA58cvywCHHGIB0GgwgAkLaco755/yCQC+WSaal2W9xBJ6/4yeQAxPYfnkOJ3onVUD /FOqJr5kB9cBB4jfcaUyEjxwZxff4kRBIAcFdMoF8vao83wQRiD3joUK4wGANdrxIauL UBhMV8TJVyltpzu1UQ0qXduVVagppexrjER9tLZDtaK2YFfXrZTwEo+BXul8v8y+oeOw tYubZ/NMdcJNPntoubYdu9fP3eVIYPbgTKrrzF3VEf/6yZrzD0rARbDQl6v5mGbms/2m XkVA== X-Gm-Message-State: AGi0PuYgue41bpzB5qSgoRW29TIqoBiEwfz9I+JW144xLibYqQPKtORU a1JzRiEuMHuF097PcRBoHNRsNQvU+lfNL5HUzx8= X-Google-Smtp-Source: APiQypJ0YM2PwRmOhYhronZHWJoEXvIbd1GS7TtYB6gmYeoIGyLqURjvKfQemtCBhofpmNnUMxyADCpw+tIhdN6pNXA= X-Received: by 2002:a05:620a:2157:: with SMTP id m23mr760590qkm.381.1588855896132; Thu, 07 May 2020 05:51:36 -0700 (PDT) MIME-Version: 1.0 References: <786dd932f06faa247e7fd3717e2d0ee39fc23581.camel@redhat.com> In-Reply-To: From: eashan gupta Date: Thu, 7 May 2020 18:21:23 +0530 Message-ID: Subject: Re: Access RTX register information To: law@redhat.com Cc: gcc-help@gcc.gnu.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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: Thu, 07 May 2020 12:51:37 -0000 Hi, Yes, thanks for replying. The above command works but it returns an IDENTIFIER_NODE so it requires IDENTIFIER_POINTER(DECL_NAME(CONST_CAST_TREE(REG_EXPR(object)))) to give the name of the variable. Thanks. Eashan On Wed, May 6, 2020 at 11:05 PM Jeff Law wrote: > On Wed, 2020-05-06 at 05:12 +0530, eashan gupta wrote: > > Hi, > > Thanks a lot for replying. > > I have tried tracing the print_rtl_single too following the REG_EXPR but > it > > ends up in the code of printing the complete tree. > Right. It's that tree structure that will have the name emebedded in it. > > > > > Is it possible to access this information directly, ie get the variable > name > > stored in a string instead of printing it out? > Probably something like DECL_NAME (REG_EXPR (object)) or > DECL_ASSEMBLER_NAME > (REG_EXPR (object)) > > > > I am not too familiar with the code for the tree and it would be very > helpful > > to me if I could get the method to get the variable name > stored/extracted from > > the tree. > You're almost certainly going to need to refer to tree.h and tree.def to > understand how to dig out the information you want. > > jeff > > > >