From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sourceware.org (Postfix) with ESMTPS id 7C5993858D28 for ; Wed, 24 May 2023 14:44:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C5993858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=irisa.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irisa.fr Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none X-Ironport-Dmarc-Check-Result: validskip X-IronPort-AV: E=Sophos;i="6.00,189,1681164000"; d="scan'208,217";a="109488584" Received: from ptb-5cg22835fs.irisa.fr (HELO [131.254.21.198]) ([131.254.21.198]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2023 16:44:21 +0200 Content-Type: multipart/alternative; boundary="------------oprZrdhRxI03pM0brY1AOCjn" Message-ID: Date: Wed, 24 May 2023 16:44:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 To: gcc@gcc.gnu.org Content-Language: fr, en-US From: Pierrick Philippe Subject: [analyzer][tree] Get the adress of a specific tree X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is a multi-part message in MIME format. --------------oprZrdhRxI03pM0brY1AOCjn Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi all, I am working around array using a plugin to the analyzer. And I face a problem here, I would like to be able to build a transformed representation of an element of the array from its subscript representation to its address representation (vice versa). To image what I'm saying, I'm looking for a way to pass from 't[(int)index]' to '&t + index * sizeof(element)', and from '&t + offset' to 't[offset / sizeof(element)]'. From now, I'll use: - "subscript form" for the 't[index]' representation. - "address form" for the '&t + offset' representation. I tried to do it manually: - only using the analyzer API (using /ana::region_model_manager::get_or_create_binop/) to get the corresponding /svalue/ (i.e. address form) of a subscript form. - by first building the /tree/ in address form using GIMPLE API (/fold_buildn/) and using analyzer API (/ana::region_model::get_rvalue/) to get its corresponding /svalue./ I managed to do it from the /tree/ in the subscript form, except that I can't use it to check if this /svalue/ is tracked within the current /sm_state_map/ because it's hash would be different than from the one potentially within the map, although they are semantically equivalent. Is there by any chance an API within the analyzer which allow to go over the live svalues? Cheers, -- Pierrick --------------oprZrdhRxI03pM0brY1AOCjn--