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

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

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

commit r11-8589-gd9f75e8a73b1b69b8f709b56296b4a9751c50ef0
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Mon Jun 7 09:25:37 2021 +0200

    tree-inline: Fix up __builtin_va_arg_pack handling [PR100898]

    The following testcase ICEs, because gimple_call_arg_ptr (..., 0)
    asserts that there is at least one argument, while we were using
    it even if we didn't copy anything just to get a pointer from/to which
    the zero arguments should be copied.

    Fixed by guarding the memcpy calls.  Also, the code was calling
    gimple_call_num_args too many times - 5 times instead of 2, so the patch
    adds two temporaries for those.

    2021-06-07  Jakub Jelinek  <ja...@redhat.com>

            PR middle-end/100898
            * tree-inline.c (copy_bb): Only use gimple_call_arg_ptr if memcpy
            should copy any arguments.  Don't call gimple_call_num_args
            on id->call_stmt or call_stmt more than once.

            * g++.dg/ext/va-arg-pack-3.C: New test.

    (cherry picked from commit d66a703c8ba86f3ca04cc10c3071696e6d014de6)

Reply via email to