From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id C6A1B3858415 for ; Sat, 11 May 2024 16:43:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6A1B3858415 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C6A1B3858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715445824; cv=none; b=EkF3oMbJb/1V24pOGZYMAn26w0dDd27zpeeo9uBGXyFoxMnbSzstoRoOfH3kzXVLsmHXxa1gsT9z6um1wv0PNO7uMQ3dOMS4qgVDSMMy4k39Br98iDTF2EI1phpKLPOjPCFtpZPlLN0woGNlGJ3HyKDDUNjsIV5tu6rag25nIiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715445824; c=relaxed/simple; bh=linb6/gtg9xT39PaQCjEg+MIa+alqi4KDhutCbMJPe0=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=WdbRzqX1nx2vLY22ivkUS0Evrx0EFvxAqc59qW3fNUCmbfpVXCPNZPwA+frNR/97saDy2Pn4Sb5NWfQ/kYfkVjGYcEcRGsh/g7YEZqWkQuf2nSLHjLv2yj5ZDf+cOOcJ5xlkJKngqYgpUH18Cea7ar8fD6QVke+/oxPWYhBfjuw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a59a5f81af4so754192566b.3 for ; Sat, 11 May 2024 09:43:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715445821; x=1716050621; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NgR8a3FFEgHou7t2QUyOFSBYRXoPdZJ0NqSLWfDGWg4=; b=PobunjEeZ9A8gF2oKkc6/v4pbJGpsXhTpSyqCc+0kAndk9cZQ4+SKbCAA7/i2zzayN PJvEChOi9CM2LKhZSVx6ltZ2UESlDMCZro+JIrhNdX7o3uMf8CuYEHBlPb1ilNoJEvqi LWAfyJrfp85iw/0hwFQx+YDm/TeOy8dZxPOFFEQbNo18aVnPyZ0n8sckEc/5f1ZQcIUn xi66xL+Hd4Zsv7QXmXVBy8m/gSEfkBzv+N2W6xdGrPtiAWOiTZPas7iwE7k3oSikW7Nd NnvTgESQz6vLQIwgRJz3m7JpgHvHGdcCdm97Q/t2X7OgcqRx4br3bW2wIf4NQb+TPAbD 6eiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715445821; x=1716050621; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NgR8a3FFEgHou7t2QUyOFSBYRXoPdZJ0NqSLWfDGWg4=; b=d1cgaBkHpZcER8LunVBLlMY3muBYYvzppSmC1l9F8GLAr1lHG7wnPHZkOvNOHI6muo xBdedKnftGYxOzfAknyfp7iy1Lr2DFzah+gCuQW/jQWrPWItpCB7Ks090bThh+NY+QZw iQyOb8nQWs0aJa3NYrtV0ipzo3FM07nqz9woqWKuabpsrP0mrndZo428RKEyiG5YICDG jVU3oQ1iAjvn8CSv0ySBWDc4AfceJSJ1IkM+5Vfjio+6sxenr/uIbfz9jwicIqnYwKnK +KYA2SouKLobqOBgfYcefSQ2CC4Dytz0jPDG6+nPsg1CQraapw0BwIbyOd3xMM/qb/W1 5U5A== X-Gm-Message-State: AOJu0Ywr2nZEzTHfGn9BHC1OLqcuP5cayWGzCS4nLpUbJsFoRK8ic2Aj rAGUzp0Yky4H7wmzUXR8J9eS2Rs0zatYQs3z5TkDb8pMsZOq+Pw3Z3jQ16bwxOcAkJZcQbrW6SZ wOULSH/KKVJZ6h9DBx5lsHaUtqXgiZ2WUjEs= X-Google-Smtp-Source: AGHT+IHIn1yAwKkFWTupBCHZBhjuX9jXf6Olh9n2bIJK5Udn5b/kkowl0Y8RMERQ8Y1pWgdD1KtoKM30UTdRXThmJ/c= X-Received: by 2002:a17:906:2dd0:b0:a59:cfe5:947d with SMTP id a640c23a62f3a-a5a2d5f1569mr393078966b.40.1715445821415; Sat, 11 May 2024 09:43:41 -0700 (PDT) MIME-Version: 1.0 References: <20240509174236.2278921-1-dmalcolm@redhat.com> <20240509174236.2278921-3-dmalcolm@redhat.com> In-Reply-To: <20240509174236.2278921-3-dmalcolm@redhat.com> From: NightStrike Date: Sat, 11 May 2024 12:43:30 -0400 Message-ID: Subject: Re: [PATCH 02/21] analyzer: Fix allocation size false positive on conjured svalue [PR109577] To: David Malcolm Cc: gcc-patches@gcc.gnu.org, Tim Lange Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP 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: On Thu, May 9, 2024 at 1:45=E2=80=AFPM David Malcolm = wrote: > > From: Tim Lange > > Currently, the analyzer tries to prove that the allocation size is a > multiple of the pointee's type size. This patch reverses the behavior > to try to prove that the expression is not a multiple of the pointee's > type size. With this change, each unhandled case should be gracefully > considered as correct. This fixes the bug reported in PR 109577 by > Paul Eggert. > > diff --git a/gcc/testsuite/gcc.dg/analyzer/pr109577.c b/gcc/testsuite/gcc= .dg/analyzer/pr109577.c > new file mode 100644 > index 00000000000..a6af6f7019f > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/analyzer/pr109577.c > @@ -0,0 +1,16 @@ > +void *malloc (unsigned long); This change missed my comment here describing this mistake: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109577#c5 Can you please fix this on all branches?