diff options
author | Jakub Jelinek <jakub@redhat.com> | 2021-06-07 09:25:37 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2021-06-07 09:25:37 +0200 |
commit | d66a703c8ba86f3ca04cc10c3071696e6d014de6 (patch) | |
tree | b7aa12a7dde48a53c2a6b9dac21df6ca2531cadb /gcc/fold-const.c | |
parent | be5efe9c12cb852c788f74f8555e6ab8d755479b (diff) | |
download | gcc-d66a703c8ba86f3ca04cc10c3071696e6d014de6.zip gcc-d66a703c8ba86f3ca04cc10c3071696e6d014de6.tar.gz gcc-d66a703c8ba86f3ca04cc10c3071696e6d014de6.tar.bz2 |
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.
Diffstat (limited to 'gcc/fold-const.c')
0 files changed, 0 insertions, 0 deletions