From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) by sourceware.org (Postfix) with ESMTPS id 97EF03860C36 for ; Tue, 30 Mar 2021 08:50:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 97EF03860C36 Received: by mail-oo1-f41.google.com with SMTP id n12-20020a4ad12c0000b02901b63e7bc1b4so3612909oor.5 for ; Tue, 30 Mar 2021 01:50:35 -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:from:date:message-id:subject:to; bh=2k2Jb5+9NzVBMYZv8KjJvT/WVQKl/Qc6CnGk4be0Jvo=; b=Fuog/XuE/HAl3GZp9nT8DTVEvnzssALqpTJb3EJXVq2+GyxCNOltwo737PBEVw63Cb R7PXVM2hwlPbEs6gEpEoBYyvrYQQmLuQn4h52m5rzH9dMKK2zmnvGphjM7vYIrdL2yl+ VA822vhCl5vrZc2q9hTuv+GX3urCnz04VSjRolEddVwYiLUxttNwG4No++5xuYPkH5Nx 1W/Tc+DM8j0eROZ7ViARopE9BP5X1GV4iD3Q4tAcfJdycP5g9mkp9egKBLJueCDLrfYH J8v9yUXR1QPiDdI+/I45YlByMm1KB1gYUXfC6sHC8Ivc8BqtiYntNQcOC3iCr18MHQKM YMPw== X-Gm-Message-State: AOAM531gR6kxMfBd1yfdoAgSVKVKSFH3yLO4Tfm3pPX68sQkZb0tDPUl pXLwTCgU39ntLfJJDcZ3sny1HwKKjGE= X-Google-Smtp-Source: ABdhPJwzGmJ3XbUiZk80zIf0CrFUUFAYa9CjfbU31o4uBBcFkWTOSahCOuevuShv5RMgIH1X6Ip1vw== X-Received: by 2002:a4a:e2c6:: with SMTP id l6mr24829459oot.31.1617094234906; Tue, 30 Mar 2021 01:50:34 -0700 (PDT) Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com. [209.85.167.171]) by smtp.gmail.com with ESMTPSA id a7sm4293795ooo.30.2021.03.30.01.50.34 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Mar 2021 01:50:34 -0700 (PDT) Received: by mail-oi1-f171.google.com with SMTP id a8so15752836oic.11 for ; Tue, 30 Mar 2021 01:50:34 -0700 (PDT) X-Received: by 2002:aca:ed94:: with SMTP id l142mr2405799oih.177.1617094234556; Tue, 30 Mar 2021 01:50:34 -0700 (PDT) MIME-Version: 1.0 From: Erick Ochoa Date: Tue, 30 Mar 2021 10:50:23 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Question about points-to analysis, global variables, IPA, and field sensitivity To: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2021 08:50:37 -0000 Hi, I am looking at the points-to analysis in GCC and I found the following comment in tree-ssa-structalias.c: /* Collect field information. */ if (use_field_sensitive && var_can_have_subvars (decl) /* ??? Force us to not use subfields for globals in IPA mode. Else we'd have to parse arbitrary initializers. */ && !(in_ipa_mode && is_global_var (decl))) >From what I understand here the points-to analysis is explicitly not using field sensitivity for global variables when in IPA. I am wondering, 0) Is "initializers" here talking about brace initializers? Or are "initializers" a little bit more abstract and refer to anything that can initialize a field? Like struct->field = function()? 1) How much work would it be to parse initializers? 2) How would global structs which are not initialized using initializers be handled? Would all fields get assigned NULL at the global variable level, but then as other fields get assigned we just create new constraints with the correct offsets? Thanks!