Avoid FROM being overwritten in expand_fix.
authorliuhongt <hongtao.liu@intel.com>
Mon, 6 Sep 2021 09:09:38 +0000 (17:09 +0800)
committerliuhongt <hongtao.liu@intel.com>
Mon, 6 Sep 2021 10:57:46 +0000 (18:57 +0800)
commit93e6809459f34ca7b5928f1729246b2e9dfb3eb4
tree3e78f62b1f520c7e20b228a3bc194232a667ee8a
parent086bb917d6efa32d9841c34a3b762f4278c762cd
Avoid FROM being overwritten in expand_fix.

For the conversion from _Float16 to int, if the corresponding optab
does not exist, the compiler will try the wider mode (SFmode here),
but when floatsfsi exists but FAIL, FROM will be rewritten, which
leads to a PR runtime error.

gcc/ChangeLog:

PR middle-end/102182
* optabs.c (expand_fix): Add from1 to avoid from being
overwritten.

gcc/testsuite/ChangeLog:

PR middle-end/102182
* gcc.target/i386/pr101282.c: New test.
gcc/optabs.c
gcc/testsuite/gcc.target/i386/pr101282.c [new file with mode: 0644]