From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15790 invoked by alias); 2 Jul 2013 03:24:31 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 15781 invoked by uid 89); 2 Jul 2013 03:24:31 -0000 X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1 Received: from mail-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 02 Jul 2013 03:24:30 +0000 Received: by mail-wi0-f177.google.com with SMTP id ey16so3713952wid.16 for ; Mon, 01 Jul 2013 20:24:28 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.183.40 with SMTP id ej8mr14009071wic.37.1372735468493; Mon, 01 Jul 2013 20:24:28 -0700 (PDT) Received: by 10.194.238.130 with HTTP; Mon, 1 Jul 2013 20:24:28 -0700 (PDT) Date: Tue, 02 Jul 2013 03:24:00 -0000 Message-ID: Subject: GIMPLE pass - Assignment evaluation From: Sandeep K Chaudhary To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2013-07/txt/msg00016.txt.bz2 Hi guys, I am writing a GIMPLE pass in which I need to inspect the assignments. For example, for the below statements, I need to find the value of the second and third assignments which are '2' and '7'. VAR1 = 1; VAR1++; VAR1 = VAR1 + 5; But the GIMPLE IR only has the following statements i.e. no optimization. VAR1_2 = 1; VAR1_3 = VAR1_2 + 1; VAR1_4 = VAR1_3 + 5; How can I make it perform calculations on RHS? Are there some flags that I can enable? Also, I thought of going with RTL passes but RTL IR seems too complex for my use and also it's not suitable for high level optimizations. Please suggest. -- Thanks and regards, Sandeep K Chaudhary.