------- Comment #4 from rguenth at gcc dot gnu dot org  2006-07-25 08:46 -------
Confirmed.  Testcase:

typedef unsigned uint64_t __attribute__((mode(DI)));
uint64_t foo(void)
{
     uint64_t x = 2147483648ULL; /* INT_MAX+1 */
     uint64_t y = (uint64_t)__builtin_round(x);
     return y;
}

where we fold it to

uint64_t y = (long long unsigned int) __builtin_lround ((double) x);


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|c                           |middle-end
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
      Known to work|                            |3.4.6
   Last reconfirmed|0000-00-00 00:00:00         |2006-07-25 08:46:28
               date|                            |
            Summary|with -O, casting result of  |[4.0/4.1/4.2 Regression]
                   |round(x) to uint64_t        |with -O, casting result of
                   |produces wrong values for x |round(x) to uint64_t
                   |> INT_MAX                   |produces wrong values for x
                   |                            |> INT_MAX
   Target Milestone|---                         |4.0.4


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

Reply via email to