This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/32668] The type-generic builtins apply default promotions
- From: "ghazi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Jul 2007 19:26:39 -0000
- Subject: [Bug middle-end/32668] The type-generic builtins apply default promotions
- References: <bug-32668-578@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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