public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/101854] [11/12 Regression] Invalid warning -Wstringop-overflow wrong argument
Date: Tue, 17 Aug 2021 20:51:36 +0000	[thread overview]
Message-ID: <bug-101854-4-WzWy5yh2VN@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101854-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Sebor <msebor@gcc.gnu.org>:

https://gcc.gnu.org/g:b48d4e6818674898f90d9358378c127511ef0f9f

commit r12-2976-gb48d4e6818674898f90d9358378c127511ef0f9f
Author: Martin Sebor <msebor@redhat.com>
Date:   Tue Aug 17 14:49:05 2021 -0600

    Move more warning code to gimple-ssa-warn-access etc.

    Also resolves:
    PR middle-end/101854 - Invalid warning -Wstringop-overflow wrong argument

    gcc/ChangeLog:

            PR middle-end/101854
            * builtins.c (expand_builtin_alloca): Move warning code to
check_alloca
            in gimple-ssa-warn-access.cc.
            * calls.c (alloc_max_size): Move code to check_alloca.
            (get_size_range): Move to pointer-query.cc.
            (maybe_warn_alloc_args_overflow): Move to
gimple-ssa-warn-access.cc.
            (get_attr_nonstring_decl): Move to tree.c.
            (fntype_argno_type): Move to gimple-ssa-warn-access.cc.
            (append_attrname): Same.
            (maybe_warn_rdwr_sizes): Same.
            (initialize_argument_information): Move code to
            gimple-ssa-warn-access.cc.
            * calls.h (maybe_warn_alloc_args_overflow): Move to
            gimple-ssa-warn-access.h.
            (get_attr_nonstring_decl): Move to tree.h.
            (maybe_warn_nonstring_arg):  Move to gimple-ssa-warn-access.h.
            (enum size_range_flags): Move to pointer-query.h.
            (get_size_range): Same.
            * gimple-ssa-warn-access.cc (has_location): Remove unused overload
            to avoid Clang -Wunused-function.
            (get_size_range): Declare static.
            (maybe_emit_free_warning): Rename...
            (maybe_check_dealloc_call): ...to this for consistency.
            (class pass_waccess): Add members.
            (pass_waccess::~pass_waccess): Defined.
            (alloc_max_size): Move here from calls.c.
            (maybe_warn_alloc_args_overflow): Same.
            (check_alloca): New function.
            (check_alloc_size_call): New function.
            (check_strncat): Handle another warning flag.
            (pass_waccess::check_builtin): Handle alloca.
            (fntype_argno_type): Move here from calls.c.
            (append_attrname): Same.
            (maybe_warn_rdwr_sizes): Same.
            (pass_waccess::check_call): Define.
            (check_nonstring_args): New function.
            (pass_waccess::check): Call new member functions.
            (pass_waccess::execute): Enable ranger.
            * gimple-ssa-warn-access.h (get_size_range): Move here from
calls.h.
            (maybe_warn_nonstring_arg): Same.
            * gimple-ssa-warn-restrict.c: Remove #include.
            * pointer-query.cc (get_size_range): Move here from calls.c.
            * pointer-query.h (enum size_range_flags): Same.
            (get_size_range): Same.
            * tree.c (get_attr_nonstring_decl): Move here from calls.c.
            * tree.h (get_attr_nonstring_decl): Move here from calls.h.

    gcc/testsuite/ChangeLog:

            * gcc.dg/attr-alloc_size-5.c: Adjust optimization to -O1.
            * gcc.dg/attr-alloc_size-7.c: Use #pragmas to adjust optimization.
            * gcc.dg/attr-alloc_size-8.c: Adjust optimization to -O1.

            PR middle-end/101854
            * gcc.dg/Wstringop-overflow-72.c: New test.

  parent reply	other threads:[~2021-08-17 20:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 23:39 [Bug c/101854] New: " nightstrike at gmail dot com
2021-08-10 23:44 ` [Bug tree-optimization/101854] " pinskia at gcc dot gnu.org
2021-08-10 23:45 ` [Bug c/101854] " nightstrike at gmail dot com
2021-08-10 23:48 ` [Bug tree-optimization/101854] " pinskia at gcc dot gnu.org
2021-08-10 23:50 ` nightstrike at gmail dot com
2021-08-10 23:51 ` pinskia at gcc dot gnu.org
2021-08-10 23:56 ` [Bug tree-optimization/101854] [11/12 Regression] " pinskia at gcc dot gnu.org
2021-08-10 23:58 ` pinskia at gcc dot gnu.org
2021-08-12 22:30 ` msebor at gcc dot gnu.org
2021-08-12 22:30 ` msebor at gcc dot gnu.org
2021-08-17 20:51 ` cvs-commit at gcc dot gnu.org [this message]
2021-08-17 20:53 ` [Bug tree-optimization/101854] [11 " msebor at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2022-12-22  2:49 ` nightstrike at gmail dot com
2023-05-29 10:05 ` jakub 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-101854-4-WzWy5yh2VN@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).