This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Committed] PR28473: wrong code folding (unsigned long long)round()
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Roger Sayle <roger at eyesopen dot com>, Richard Guenther <rguenther at suse dot de>
- Date: Wed, 26 Jul 2006 12:27:49 +0200
- Subject: Re: [Committed] PR28473: wrong code folding (unsigned long long)round()
- References: <44C737C8.5070202@gmail.com>
Uros Bizjak wrote:
2006-07-25 Roger Sayle <roger@eyesopen.com>
PR middle-end/28473
* convert.c (convert_to_integer): When transforming (T)foo(x) into
bar(x) check that bar's result type can represent all the values
of T.
* gcc.dg/fold-convround-1.c: New test case.
Your patch introduces a regression on x86_64:
The failure can be shown by this testcase:
long long test(double x)
{
return round (x);
}
The round() is now converted into lround() on targets, where sizeof
(long) is 8. Following .original dump is produced:
;; Function test (test)
;; enabled by -tree-original
{
return (long long int) __builtin_lround (x);
}
Uros.