]> git.ipfire.org Git - thirdparty/gcc.git/commit
rs6000: Handle unresolved overloaded builtin [PR105485]
authorKewen.Lin <linkw@gcc.gnu.org>
Tue, 13 Sep 2022 09:13:59 +0000 (04:13 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Wed, 21 Sep 2022 02:31:42 +0000 (21:31 -0500)
commit104864f99c07f87b53c7f45c50a1991b21249489
tree0774fe52d9ff487b602f9626c3b29628ef462f36
parent93612f9c21540e94e003dfe925df4f0e77d38e34
rs6000: Handle unresolved overloaded builtin [PR105485]

PR105485 exposes that new builtin function framework doesn't handle
unresolved overloaded builtin function well.  With new builtin
function support, we don't have builtin info for any overloaded
rs6000_gen_builtins enum, since they are expected to be resolved to
one specific instance.  So when function rs6000_gimple_fold_builtin
faces one unresolved overloaded builtin, the access for builtin info
becomes out of bound and gets ICE then.

We should not try to fold one unresolved overloaded builtin there
and as the previous support we should emit one error message during
expansion phase like "unresolved overload for builtin ...".

PR target/105485

gcc/ChangeLog:

* config/rs6000/rs6000-builtin.cc (rs6000_gimple_fold_builtin): Add
the handling for unresolved overloaded builtin function.
(rs6000_expand_builtin): Likewise.

gcc/testsuite/ChangeLog:

* g++.target/powerpc/pr105485.C: New test.

(cherry picked from commit 94504c9ae157db937a2e62d533a36d56598f3c09)
gcc/config/rs6000/rs6000-builtin.cc
gcc/testsuite/g++.target/powerpc/pr105485.C [new file with mode: 0644]