[PATCH] PR middle-end/53267: Constant fold BUILT_IN_FMOD.

Roger Sayle roger@nextmovesoftware.com
Tue Jun 8 19:10:24 GMT 2021


Here's a three line patch to implement constant folding for fmod,
fmodf and fmodl, which resolves an enhancement request from 2012.

The following patch has been tested on x86_64-pc-linux-gnu with
a make bootstrap and make -k check with no new failures.

Ok for mainline?


2020-06-08  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR middle-end/53267
	* fold-const-call.c (fold_const_call_sss) [CASE_CFN_FMOD]:
	Support evaluation of fmod/fmodf/fmodl at compile-time.

gcc/testsuite/ChangeLog
	* gcc.dg/builtins-70.c: New test.


Roger
--
Roger Sayle
NextMove Software
Cambridge, UK

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patchf.txt
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210608/b15d07be/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: builtins-70.c
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20210608/b15d07be/attachment.c>


More information about the Gcc-patches mailing list