[Bug fortran/24518] Intrinsic MOD incorrect for large arg1/arg2 and slow.

uros at kss-loka dot si gcc-bugzilla@gcc.gnu.org
Wed Oct 25 14:16:00 GMT 2006



------- Comment #10 from uros at kss-loka dot si  2006-10-25 14:16 -------
(In reply to comment #9)

> > In the later case, expansion will fall-back to normal library call.
> 
> OK. So on system where the math library doesn't have remainderl, for example,
> we shouldn't use BUILT_IN_REMAINDERL or it will be missing at link-time? If
> that's the case, then we can't implement MOD/MODULO with these built-ins.

You can check for TARGET_C99_FUNCTIONS before they are used.

> > Fortunatelly, no. The result will be correct. You can see the effect of
> > -fno-math-errno at http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01158.html.
> 
> And now, a harder question: could we activate no-math-errno on a per-call
> basis? That is, have the front-end emit a call to BUILT_IN_FOO and specify
> that, for this call, errno doesn't have to be set?

errno expansion for this particular built-in is inhibited in line 1995 of
builtins.c. For a per-call basis, we need an argument to expand_builtin()
function to disable errno expansion. However, the rationale for this is unclear
to me. IMO - either we use errno, or we don't. 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24518



More information about the Gcc-bugs mailing list