From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C09EB3857C49; Fri, 16 Feb 2024 19:35:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C09EB3857C49 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708112102; bh=yOWEq7lBwhDmJoGmZaI+zasv3esPydvdojARq7COAMs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JL9SykgKYiH9m3YQOnayEvmeQJOYXMDd6ZuQgXsMjtzoR4M4SOwdxJ/MGQvy4tsO2 ycSXUHb5+/VFrXvyfJ5msbVv9ueYPItgxUMK+cy5Sl6IEFB1b+ZKWw91tU3+7p1aa/ d6HlzFgok1k9E5BBIsUnJwqbNzdakKbENvydyR3w= From: "nightstrike at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug analyzer/105755] -Wanalyzer-null-dereference regression compiling Emacs Date: Fri, 16 Feb 2024 19:35:02 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: analyzer X-Bugzilla-Version: 12.1.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: nightstrike at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WORKSFORME X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: dmalcolm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105755 --- Comment #5 from nightstrike --- (In reply to David Malcolm from comment #4) > Looks like this was fixed sometime in GCC 13; resolving as WORKSFORME. >=20 > Feel free to reopen if you have a reproducer that triggers on a more rece= nt > GCC. The testcase still fails. To be clear, I'm referring to null-deref-pr10575= 5.c: Executing on host: /tmp/gcc/src/gcc-git/_w/gcc/xgcc -B/tmp/gcc/src/gcc-git/_w/gcc/ exceptions_enabled705865.cc=20 -fdiagnostics-plain-output -Wno-complain-wrong-lang -S -o exceptions_enabled705865.s (timeout =3D 300) spawn -ignore SIGHUP /tmp/gcc/src/gcc-git/_w/gcc/xgcc -B/tmp/gcc/src/gcc-git/_w/gcc/ exceptions_enabled705865.cc -fdiagnostics-plain-output -Wno-complain-wrong-lang -S -o exceptions_enabled705865.s^M FAIL: gcc.dg/analyzer/null-deref-pr105755.c (test for excess errors) Excess errors: /tmp/gcc/src/gcc-git/gcc/testsuite/gcc.dg/analyzer/null-deref-pr105755.c:19= :10: warning: cast from pointer to integer of different size [-Wpointer-to-int-c= ast] testcase /tmp/gcc/src/gcc-git/gcc/testsuite/gcc.dg/analyzer/analyzer.exp completed in 0 seconds With this change: --- a/gcc/testsuite/gcc.dg/analyzer/null-deref-pr105755.c +++ b/gcc/testsuite/gcc.dg/analyzer/null-deref-pr105755.c @@ -2,7 +2,7 @@ /* { dg-additional-options "-Wno-analyzer-too-complex -Wno-analyzer-symbol-too-complex -O2" } */ typedef long int ptrdiff_t; -typedef long int EMACS_INT; +typedef __UINTPTR_TYPE__ EMACS_INT; typedef long int intmax_t; enum Lisp_Type Then I get this: PASS: gcc.dg/analyzer/null-deref-pr105755.c (test for excess errors) If I open your godbolt links, they aren't using a Windows target compiler, = so they aren't exercising an LLP64 target. Generally speaking, most of the analyzer testsuite assumes incorrect definitions of things. For instance, in the diff I just posted, you can see that the lines before and after also assume the underlying types of ptrdiff= _t and intmax_t instead of using compiler builtins or just including the relev= ant headers. This is really needs to be fixed across the whole testsuite.=