From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailg210.ethz.ch (mailg210.ethz.ch [IPv6:2001:67c:10ec:5606::21]) by sourceware.org (Postfix) with ESMTPS id 264083856082 for ; Mon, 30 May 2022 14:08:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 264083856082 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=inf.ethz.ch Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=inf.ethz.ch Received: from mailm214.d.ethz.ch (2001:67c:10ec:5603::28) by mailg210.ethz.ch (2001:67c:10ec:5606::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Mon, 30 May 2022 16:08:23 +0200 Received: from [129.132.31.90] (129.132.31.90) by mailm214.d.ethz.ch (2001:67c:10ec:5603::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.9; Mon, 30 May 2022 16:08:29 +0200 Message-ID: Date: Mon, 30 May 2022 16:08:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Content-Language: en-US To: From: Theodoros Theodoridis Subject: Value Range Analysis of source code variables X-Originating-IP: [129.132.31.90] X-ClientProxiedBy: mailm214.d.ethz.ch (2001:67c:10ec:5603::28) To mailm214.d.ethz.ch (2001:67c:10ec:5603::28) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HTML_MESSAGE, KAM_DMARC_STATUS, 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 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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: Mon, 30 May 2022 14:08:36 -0000 Hello, is there a way to query the value range analysis results for source-code level variables? For example, given the following piece of code: |static int a = 0; int main(){ int b = 42; if (b > 0){ a = 2; } b = 1; return 0; } | Is there a way to “ask” gcc what the value ranges (or sets) of |a| and |b| are? The result would be, assuming gcc can figure this out, |a = {0,2}| and |b = {1, 42}| or |a in [0,2]| and |b in [1,42]|. Thanks, Theo