------- Comment #1 from ghazi at gcc dot gnu dot org  2007-07-07 19:26 -------
Here's a testcase:

int foo1 (float fp)
{
  return __builtin_isnan (fp);
}

int foo2 (float fp)
{
  return __builtin_isnan ((double)fp);
}

int foo3 (double fp)
{
  return __builtin_isnan (fp);
}

int foo4 (long double fp)
{
  return __builtin_isnan (fp);
}

when compiled with -fdump-tree-original using mainline I get:


;; Function foo1 (foo1)
;; enabled by -tree-original


{
  return SAVE_EXPR <(double) fp> unord SAVE_EXPR <(double) fp>;
}



;; Function foo2 (foo2)
;; enabled by -tree-original

{
  return SAVE_EXPR <(double) fp> unord SAVE_EXPR <(double) fp>;
}



;; Function foo3 (foo3)
;; enabled by -tree-original

{
  return fp unord fp;
}



;; Function foo4 (foo4)
;; enabled by -tree-original

{
  return fp unord fp;
}

The function foo1 should not have the argument cast to double, but because it's
variadic, the default C promotion rules apply.


-- 


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

Reply via email to