From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) by sourceware.org (Postfix) with ESMTPS id 60C63389087D for ; Tue, 5 May 2020 23:42:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 60C63389087D Received: by mail-qt1-x82b.google.com with SMTP id l18so73326qtp.0 for ; Tue, 05 May 2020 16:42:52 -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=85hUxx8W0toVb5zQs0g4fqi3UuYBEjlkNl0uJsEB7Jc=; b=gA9PI6zMxBnLFrJKncA+XFTzKoPF1o8CQpsG7/EZsdbLdst7bxB49EI1hkHETYY1jw EkcUchBWnOuyRgKXMolrEGXDxDWxABX41ApOgA/nF4e1i/b6ilBEg4oiM5Yx3ewo8efN 5REODklF2/18PxSVMk8nC78z0s6uMEaAs5spiT0TraUmEZmjGGeYyznE9P9w82UF6/BR T7PGJ8fA1WndK0AreSWhKLx30LXZUjuDKeGerr17/FvhGTM4ABjz8h8XNG0DrswlHG8D pfgQGH0nz/OUFXrctDBy7NKRNo7MaLxhQ1s7Hi3l0ITSh8HfOupYyN6wZnLkri0seSSw Vr5w== X-Gm-Message-State: AGi0PubO3Et7o6BFlLr8pJNIDmnrxLJjicUb1lNjXyH0x6pB/ZQ2a+Uu gYNTBA/I5mZt9zemXeQ6iqt2o6s+bp/DYyprd9o= X-Google-Smtp-Source: APiQypIHoYS9eV1veB71dGyC88LYXHCv0OJC2iLMdWv3aT5FhnjGW1f9OVbk01Wx58hkgstfUoNGAFOzbAgzsif143M= X-Received: by 2002:ac8:27b4:: with SMTP id w49mr648595qtw.111.1588722171798; Tue, 05 May 2020 16:42:51 -0700 (PDT) MIME-Version: 1.0 References: <786dd932f06faa247e7fd3717e2d0ee39fc23581.camel@redhat.com> In-Reply-To: <786dd932f06faa247e7fd3717e2d0ee39fc23581.camel@redhat.com> From: eashan gupta Date: Wed, 6 May 2020 05:12:39 +0530 Message-ID: Subject: Re: Access RTX register information To: law@redhat.com Cc: gcc-help@gcc.gnu.org X-Spam-Status: No, score=-3.8 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: Tue, 05 May 2020 23:42:53 -0000 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. Is it possible to access this information directly, ie get the variable name stored in a string instead of printing it out? 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. Thanks in advance. Eashan On Wed, May 6, 2020 at 4:36 AM Jeff Law wrote: > 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 > >