[Bug target/88630] Incorrect float negating together with convertion to int on ST-40
olegendo at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Oct 2 00:56:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88630
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2019-10-02
Ever confirmed|0 |1
--- Comment #10 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Zavadovsky Yan from comment #9)
>
> Checked GCC 8.2 + your patch and crosstool-ng to build toolchain(using same
> config as I've used while reporting bug).
>
> At least it works on attached main.cpp.
> Got no assert when run on our STiH237-based board.
OK, thanks for confirming it. I think the fabs instruction is affected in the
same way.
I have to think about how to integrate this fix. We can set it as a default
behavior for all FPU-capable SH4 variants, but that will pessimize it for
everything.
The other option is to enable this only for your specific CPU (ST-40), which
would require you to use the -m4-300 option, not the -m4 option. I would
recommend you to use -m4-300 as it will also enable some other features which
will generate better code than running plain SH4 code with -m4.
If we tie this fix to -m4-300, if you're building a linux system, you will need
to build the compiler with -m4-300 as a default, instead of -m4. If not doing
linux with a generic sh-elf bare-metal compiler, you'd need to specify -m4-300
when compiling all the software. Would that be feasible for you?
More information about the Gcc-bugs
mailing list