From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74589 invoked by alias); 18 Dec 2017 12:31:09 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 74577 invoked by uid 89); 18 Dec 2017 12:31:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KAM_SHORT,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*i:sk:CACEoar, H*f:sk:Ad0akFQ, H*f:sk:CACEoar, H*i:sk:Ad0akFQ X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 18 Dec 2017 12:31:07 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 357DB1435; Mon, 18 Dec 2017 04:31:06 -0800 (PST) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B243B3F24A; Mon, 18 Dec 2017 04:31:05 -0800 (PST) Message-ID: <5A37B508.4080209@foss.arm.com> Date: Mon, 18 Dec 2017 12:31:00 -0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: HEBBAL Yacine , "gcc@gcc.gnu.org" Subject: Re: Load and parse RTL from textual dump files References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-12/txt/msg00104.txt.bz2 Hi, On 18/12/17 10:30, HEBBAL Yacine wrote: > Hello, > In one of my projects, I need to determine automatically what are the > names > and types of data fields manipulated by functions in binary code of a > given > program (e.g. Linux kernel). > I found that RTL dumps contains most of information I need in a form very > close to the one of the binary code. > For this end, I need to parse generated RTL expressions in order to > extract > operands properties. > Is it possible to load and parse RTL expressions from textual dump files > using existing code in GCC ? Thanks Since version 7 GCC does contain functionality to parse RTL input. This is mostly used for writing more targeted unit tests for the RTL passes. Have a look at https://gcc.gnu.org/onlinedocs/gccint/RTL-Tests.html or grep for "__RTL" in the gcc testsuite (gcc/testsuite in the source tree) to see examples of how it's used. Not sure how useful it will be for large-scale analysis of source code though. You may want to write/use a GCC plugin for that. Kyrill P.S. This list is used for discussions about the development of GCC itself. For help using GCC please use the gcc-help list in the future.