From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by sourceware.org (Postfix) with ESMTPS id C7A1C3858D35 for ; Thu, 23 Dec 2021 21:49:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C7A1C3858D35 Received: by mail-wr1-x42b.google.com with SMTP id s1so13911313wra.6 for ; Thu, 23 Dec 2021 13:49:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:cc:to; bh=3Q7MX6GSLPP4VkiP30RwshAk63wKGZsBHfYONl71K8E=; b=RltfDMTWocE3qMkdKIr2BAlChwEBlKkyqJQx/frnYL0AMgLUrpxCW01FVozwzqgc8T D3wHHpxfzOlMUhQioI40fpQJWLjYKwHySIW/YUugJwi8IRL4v4M16hPagbtk9HmW4kSR l1QHsv7U6ltZts26Izz1/GLlQgoW+O7AJhWxE8XQRefuk+eZTWmJgKuew0XFXQgI4tzE r/ZW8Xe9gVHUzbTRZpYM36M7WPH9qKj3zYFKZLpeVNIq9TXOqHcWdVJo+8rUAfyzab/t /EPAhLP8HFtiK/3wlMg8asRb+4OvDCu4Z40YzTUXEEf+Ml/d71vAqKUFmxnkj3uIMLhu Mk0A== X-Gm-Message-State: AOAM533WCL2RnPPpvIfFxYsLryltB5rRu2UQoG1PHsZ1lfMjU/keG0Z0 B1rRE53o+lgXDAQ/IZBhnwXgwaH16Xk= X-Google-Smtp-Source: ABdhPJy62NpBQkuQs0tBwfQPYUnjOo5Lg6lmYJYC7WAUexKKuhinNNwVPHtGUJGuEMQCw2nyYAA46w== X-Received: by 2002:a5d:5689:: with SMTP id f9mr2801256wrv.124.1640296157756; Thu, 23 Dec 2021 13:49:17 -0800 (PST) Received: from smtpclient.apple ([2a01:e34:ec28:8cb0:b08b:53d9:210c:1426]) by smtp.gmail.com with ESMTPSA id o12sm6823792wrc.69.2021.12.23.13.49.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Dec 2021 13:49:17 -0800 (PST) From: FX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.40.0.1.81\)) Subject: Many analyzer failures on non-Linux system (x86_64-apple-darwin) Message-Id: <3BD093C3-178E-4B11-BDA1-9604ADCA4B04@gmail.com> Date: Thu, 23 Dec 2021 22:49:16 +0100 Cc: dmalcolm@redhat.com, Iain Sandoe To: gcc@gcc.gnu.org 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: Thu, 23 Dec 2021 21:49:20 -0000 Hi David, hi everone, 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 ## gcc.dg/analyzer/torture/asm-x86-linux-*.c 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: 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 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: FAIL: gcc.dg/analyzer/asm-x86-lp64-1.c ## Builtin-related failures Those four cases fail: gcc.dg/analyzer/data-model-1.c gcc.dg/analyzer/pr103526.c gcc.dg/analyzer/taint-size-1.c gcc.dg/analyzer/write-to-string-literal-1.c 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: #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 where __darwin_obsz0 is defined thusly: #define __darwin_obsz0(object) __builtin_object_size (object, 0) 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. Best, FX=