GCC Bugzilla – Bug 31796
Evaluate remquo/remainder/drem at compile-time
Last modified: 2007-05-19 05:14:33 UTC
GCC should use MPFR to evaluate builtins remquo, remainder (and the common extension function drem) at compile-time when they are provided with constant arguments. The forthcoming mpfr-2.3.0 has suitable functionality to do this.
Patch posted here:
Subject: Bug number PR middle-end/31796
A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-05/msg00297.html
Subject: Bug 31796
Date: Fri May 18 01:31:20 2007
New Revision: 124820
* builtins.c (do_mpfr_remquo): New.
(fold_builtin_2): Handle BUILT_IN_DREM/BUILT_IN_REMAINDER.
(fold_builtin_3): Handle BUILT_IN_REMQUO.
* gcc.dg/torture/builtin-math-2.c: Add tests for remquo, remainder
* gcc.dg/torture/builtin-math-4.c: Likewise.
Functionality installed on trunk.