This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/28473] [4.0/4.1/4.2 Regression] with -O, casting result of round(x) to uint64_t produces wrong values for x > INT_MAX
- From: "roger at eyesopen dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jul 2006 20:02:46 -0000
- Subject: [Bug middle-end/28473] [4.0/4.1/4.2 Regression] with -O, casting result of round(x) to uint64_t produces wrong values for x > INT_MAX
- References: <bug-28473-13001@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from roger at eyesopen dot com 2006-07-25 20:02 -------
Grr. I've just noticed richi has just assigned this patch to himself.
I also have a patch that been bootstrapped and has nearly finished
regression testing, that I was just about to post/commit. richi what
does your fix look like?
Mine contains several copies of:
if (!TARGET_C99_FUNCTIONS)
break;
! if (outprec < TYPE_PRECISION (long_integer_type_node)
! || (outprec == TYPE_PRECISION (long_integer_type_node)
! && !TYPE_UNSIGNED (type)))
fn = mathfn_built_in (s_intype, BUILT_IN_LCEIL);
+ else if (outprec == TYPE_PRECISION (long_long_integer_type_node)
+ && !TYPE_UNSIGNED (type))
+ fn = mathfn_built_in (s_intype, BUILT_IN_LLCEIL);
break;
[Serves me right for not assigning this when pinkia asked me to investigate.
I knew there was a good reason I don't normally bother with recent PRs].
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28473