From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 8D6F63858C60 for ; Mon, 10 Jan 2022 16:13:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D6F63858C60 Received: by mail-wm1-x32e.google.com with SMTP id 25-20020a05600c231900b003497473a9c4so1150033wmo.5 for ; Mon, 10 Jan 2022 08:13:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=sAGhV6YlyUGmKGlx4Lxx5Itw3sTPIi4+Stvm9cuFxSE=; b=48feU+Kaqjlh0fyRiSYLbrT8JkznOg66liMauhVwGYFIS6ZQIOq0ngjTAwFD6YKa7U 8HD7UsobOz4tBYL5TLJd1seSAzG5PWo57V9j9JNkl+bo0HxfG4zZZ1yrRVWSRQUjxYF6 35OShlNN+eUsviCy5LDYzJxSKyXlIRYAmWjO8vp8+N6NUJtPS7+BnPC2hh+E1IzckKoW 50xl4SQND1lbQlLLbrTfhnHFA7B3fJoWplAU2mvysx7z6ug1+v/iRzRK6YdSedpcVZfu bgorzO4zxOVG97Bg11FlqWGzxulb8/9HIEUC5RZaXYyjA9zwcD1Bdxzhh8bI54ueV6zH 1OSA== X-Gm-Message-State: AOAM5318TtW3wDPcXHOkD/Av/2kZRsZQdO+5VbiYx+BsnOg64YQo76XA iUqOOiZVgkNds8VVkU4qRyWMKWhfxNs= X-Google-Smtp-Source: ABdhPJy/HkSZ/mmnmeskdYfPZLyI2d4E1isqAeKvrig8RzayJUZOK55nbOJ8e6uvhsMGdVSZ3VwsKQ== X-Received: by 2002:a05:600c:3b28:: with SMTP id m40mr158903wms.192.1641831204614; Mon, 10 Jan 2022 08:13:24 -0800 (PST) Received: from smtpclient.apple ([2a01:e34:ec28:8cb0:b9be:e8f6:b56f:a6a1]) by smtp.gmail.com with ESMTPSA id c11sm8117274wmq.48.2022.01.10.08.13.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jan 2022 08:13:24 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Subject: Re: Many analyzer failures on non-Linux system (x86_64-apple-darwin) From: FX In-Reply-To: <3BD093C3-178E-4B11-BDA1-9604ADCA4B04@gmail.com> Date: Mon, 10 Jan 2022 17:13:23 +0100 Cc: dmalcolm@redhat.com, Iain Sandoe Content-Transfer-Encoding: quoted-printable Message-Id: <237CA1D3-29E0-4252-8EDC-DC562BA042A2@gmail.com> References: <3BD093C3-178E-4B11-BDA1-9604ADCA4B04@gmail.com> To: GCC Mailing List X-Mailer: Apple Mail (2.3693.40.0.1.81) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 10 Jan 2022 16:13:26 -0000 Hi David, May I kindly ping you on that? Or anyone with knowledge of the static = analyzer? Thanks, FX > Le 23 d=C3=A9c. 2021 =C3=A0 22:49, FX a =C3=A9crit= : >=20 > Hi David, hi everone, >=20 > I=E2=80=99m trying to understand how best to fix or silence the = several failures in gcc.dg/analyzer that occur on x86_64-apple-darwin. = Some of them, according to gcc-testresults, also occur on other = non-Linux targets. See for example, the test results at = https://gcc.gnu.org/pipermail/gcc-testresults/2021-December/743901.html >=20 > ## gcc.dg/analyzer/torture/asm-x86-linux-*.c >=20 > Are these supposed to be run only on Linux (as the name implies)? Four = of them fail on x86_64-apple-darwin, because they use assembly that is = not supported: >=20 > FAIL: gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c > FAIL: gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-2.c > FAIL: gcc.dg/analyzer/torture/asm-x86-linux-rdmsr-paravirt.c > FAIL: gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c >=20 > Should they be restricted to Linux targets? There is another one that = has the same error, as well, although it doesn=E2=80=99t have linux in = the name: >=20 > FAIL: gcc.dg/analyzer/asm-x86-lp64-1.c >=20 >=20 > ## Builtin-related failures >=20 > Those four cases fail: >=20 > gcc.dg/analyzer/data-model-1.c >=20 > gcc.dg/analyzer/pr103526.c > gcc.dg/analyzer/taint-size-1.c > gcc.dg/analyzer/write-to-string-literal-1.c >=20 > but pass if the function calls (memset and memcpy) are replaced by the = built-in variant (__builtin_memset and __builtin_memcpy). The reason for = that is the darwin headers, in (included from = ) does this: >=20 > #if __has_builtin(__builtin___memcpy_chk) || defined(__GNUC__) > #undef memcpy > /* void *memcpy(void *dst, const void *src, size_t n) */ > #define memcpy(dest, ...) \ > __builtin___memcpy_chk (dest, __VA_ARGS__, = __darwin_obsz0 (dest)) > #endif >=20 > where __darwin_obsz0 is defined thusly: >=20 > #define __darwin_obsz0(object) __builtin_object_size (object, 0) >=20 >=20 > Does the analyzer not handle the _chk builtin variants? Should it? > I=E2=80=99m happy to investigate more, but I=E2=80=99m not sure what = to do. >=20 >=20 > Best, > FX