[Bug testsuite/30181] FAIL: gcc.dg/builtins-57.c scan-tree-dump trunc

dave at hiauly1 dot hia dot nrc dot ca gcc-bugzilla@gcc.gnu.org
Thu Dec 14 19:56:00 GMT 2006



------- Comment #9 from dave at hiauly1 dot hia dot nrc dot ca  2006-12-14 19:55 -------
Subject: Re:  FAIL: gcc.dg/builtins-57.c scan-tree-dump trunc

> trunc maybe available in the library, but gcc thinks it is not.  Otherwise the
> testcase wouldn't fail - it tests for the transformation of floor (x) to trunc
> (x)
> if x is known to be positive.

If I understand correctly, the transformation only occurs when
TARGET_C99_FUNCTIONS is true.  In the linux case, this depends on
OPTION_GLIBC.  Can't figure out how OPTION_GLIBC gets defined...

It would be really nice if there was a way for a target to say
which C99 functions are implicitly available when it has a partial
set.  Possibly, this code could be modified to add a target callback:

  if (implicit_p)
    implicit_built_in_decls[(int) fncode] = decl;

For example, something like:

  if (implicit_p && targetm.implicit_built_in_p (fncode))
    implicit_built_in_decls[(int) fncode] = decl;

Doing this might create a few problems for the libraries and testsuite,
but it should improve code optimization.

> Now if std=c99 does not help I can only make this a link-time testcase like
> (-ffinite-math-only to allow folding the FP comparison).
> 
> That does work, right?

The test program works.

Dave


-- 


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



More information about the Gcc-bugs mailing list