public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "geoffreydgr at icloud dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug analyzer/107948] GCC Static Analyzer doesn't realize `0 - width <= 0` is always true when `width > 0` and `width is int` type,
Date: Sat, 03 Dec 2022 06:57:14 +0000	[thread overview]
Message-ID: <bug-107948-4-QlDtPfrHzH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107948-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Geoffrey <geoffreydgr at icloud dot com> ---
(In reply to CVS Commits from comment #1)
> The master branch has been updated by David Malcolm <dmalcolm@gcc.gnu.org>:
> 
> https://gcc.gnu.org/g:0b737090a69624dea5318c380620283f0321a92e
> 
> commit r13-4456-g0b737090a69624dea5318c380620283f0321a92e
> Author: David Malcolm <dmalcolm@redhat.com>
> Date:   Thu Dec 1 21:28:55 2022 -0500
> 
>     analyzer: handle comparisons against negated symbolic values [PR107948]
>     
>     gcc/analyzer/ChangeLog:
>             PR analyzer/107948
>             * region-model-manager.cc
>             (region_model_manager::maybe_fold_binop): Fold (0 - VAL) to -VAL.
>             * region-model.cc (region_model::eval_condition): Handle e.g.
>             "-X <= 0" as equivalent to X >= 0".
>     
>     gcc/testsuite/ChangeLog:
>             PR analyzer/107948
>             * gcc.dg/analyzer/feasibility-pr107948.c: New test.
>     
>     Signed-off-by: David Malcolm <dmalcolm@redhat.com>

Thanks for your effort!

  parent reply	other threads:[~2022-12-03  6:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 14:07 [Bug analyzer/107948] New: " geoffreydgr at icloud dot com
2022-12-02  2:31 ` [Bug analyzer/107948] " cvs-commit at gcc dot gnu.org
2022-12-02  2:39 ` dmalcolm at gcc dot gnu.org
2022-12-03  6:57 ` geoffreydgr at icloud dot com [this message]
2023-03-29 18:18 ` cvs-commit 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-107948-4-QlDtPfrHzH@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).