]> git.ipfire.org Git - thirdparty/gcc.git/commit
i386: Fix up ICE with -mveclibabi={acml,svml} [PR105367]
authorJakub Jelinek <jakub@redhat.com>
Tue, 26 Apr 2022 07:40:03 +0000 (09:40 +0200)
committerJakub Jelinek <jakub@redhat.com>
Tue, 26 Apr 2022 07:40:03 +0000 (09:40 +0200)
commit5face32b7f439bba283e2eeb2a50f192d605bf57
tree031b130bcae306a5f61f34be1e3d89b52d2f1181
parent22c24ba48a20a4944a50cca06449debed7d1b3f4
i386: Fix up ICE with -mveclibabi={acml,svml} [PR105367]

The following testcase ICEs, because conversion between scalar float types
which have the same mode are useless in GIMPLE, but for mathfn_built_in the
exact type matters (it treats say double and _Float64 or float and _Float32
differently, using different suffixes and for the _Float* sometimes
returning NULL when float/double do have a builtin).

In ix86_veclibabi_{svml,acml} we are using mathfn_built_in just so that
we don't have to translate the combined_fn and SFmode vs. DFmode into
strings ourselfs, and we already earlier punt on anything but SFmode and
DFmode.  So, this patch just uses the double or float types depending
on the modes, rather than the types we actually got and which might be
_Float64 or _Float32 etc.

2022-04-26  Jakub Jelinek  <jakub@redhat.com>

PR target/105367
* config/i386/i386.cc (ix86_veclibabi_svml, ix86_veclibabi_acml): Pass
el_mode == DFmode ? double_type_node : float_type_node instead of
TREE_TYPE (type_in) as first arguments to mathfn_built_in.

* gcc.target/i386/pr105367.c: New test.
gcc/config/i386/i386.cc
gcc/testsuite/gcc.target/i386/pr105367.c [new file with mode: 0644]