[Bug middle-end/100898] [9/10 Regression] ICE with -O2: in gimple_call_arg_ptr, at gimple.h:3264

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue May 10 08:18:24 GMT 2022


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

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

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

commit r10-10616-gfb6579667cd87bc41afbd81b876e8e571712d289
Author: Jakub Jelinek <jakub@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  <jakub@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)


More information about the Gcc-bugs mailing list