public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nightstrike at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-105755-4-7hVb5wifXa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105755-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105755

--- Comment #5 from nightstrike <nightstrike at gmail dot com> ---
(In reply to David Malcolm from comment #4)
> Looks like this was fixed sometime in GCC 13; resolving as WORKSFORME.
> 
> Feel free to reopen if you have a reproducer that triggers on a more recent
> GCC.

The testcase still fails.  To be clear, I'm referring to null-deref-pr105755.c:

Executing on host: /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    (timeout = 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-cast]

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 relevant
headers.  This is really needs to be fixed across the whole testsuite.

  parent reply	other threads:[~2024-02-16 19:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-28  3:49 [Bug analyzer/105755] New: " eggert at cs dot ucla.edu
2023-03-09 21:21 ` [Bug analyzer/105755] " cvs-commit at gcc dot gnu.org
2024-01-28  8:19 ` nightstrike at gmail dot com
2024-02-16 14:35 ` dmalcolm at gcc dot gnu.org
2024-02-16 14:39 ` dmalcolm at gcc dot gnu.org
2024-02-16 19:35 ` nightstrike at gmail dot com [this message]
2024-02-16 19:39 ` nightstrike at gmail dot com
2024-02-16 19:41 ` iains at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-105755-4-7hVb5wifXa@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).