This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Committed] PR28473: wrong code folding (unsigned long long)round()


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]