xtensa: Minor fix for FP constant synthesis
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>
Wed, 13 Jul 2022 11:40:13 +0000 (20:40 +0900)
committerMax Filippov <jcmvbkbc@gmail.com>
Thu, 14 Jul 2022 07:03:35 +0000 (00:03 -0700)
commite85c94d1c83072d7b894e44009e876dd41ff778a
treecb9512b831dcd9871ab2e15674f06e4efb4759c7
parentcff72485b1d5682a0c55f45b6e6f023c98739862
xtensa: Minor fix for FP constant synthesis

This patch fixes an non-fatal issue about negative constant values derived
from FP constant synthesis on hosts whose 'long' is wider than 'int32_t'.

And also replaces the dedicated code in FP constant synthesis split
pattern with the appropriate existing function call.

gcc/ChangeLog:

* config/xtensa/xtensa.md:
In FP constant synthesis split pattern, subcontract to
avoid_constant_pool_reference() as in the case of integer,
because it can handle well too.  And cast to int32_t before
calling xtensa_constantsynth() in order to ignore upper 32-bit.

gcc/testsuite/ChangeLog:

* gcc.target/xtensa/constsynth_double.c:
Modify in order to catch the issue.
gcc/config/xtensa/xtensa.md
gcc/testsuite/gcc.target/xtensa/constsynth_double.c