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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

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

commit r12-5294-geacdfaf7ca07367ede1a0c50aa997953958dabae
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Tue Nov 16 10:18:25 2021 +0100

    waccess: Fix up pass_waccess::check_alloc_size_call [PR102009]

    This function punts if the builtins have no arguments, but as can be seen
    on the testcase, even if it has some arguments but alloc_size attribute's
    arguments point to arguments that aren't passed, we get a warning earlier
    from the FE but should punt rather than ICE on it.
    Other users of alloc_size attribute e.g. in
    tree-object-size.c (alloc_object_size) punt similarly and similarly
    even in the same TU maybe_warn_nonstring_arg correctly verifies calls have
    enough arguments.

    2021-11-16  Jakub Jelinek  <ja...@redhat.com>

            PR tree-optimization/102009
            * gimple-ssa-warn-access.cc (pass_waccess::check_alloc_size_call):
            Punt if any of alloc_size arguments is out of bounds vs. number of
            call arguments.

            * gcc.dg/pr102009.c: New test.

Reply via email to