public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "law at redhat dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/27364] [4.1/4.2 Regression] VRP miscompiles some unsigned math
Date: Tue, 02 May 2006 19:44:00 -0000	[thread overview]
Message-ID: <20060502194402.3761.qmail@sourceware.org> (raw)
In-Reply-To: <bug-27364-682@http.gcc.gnu.org/bugzilla/>



------- Comment #14 from law at redhat dot com  2006-05-02 19:44 -------
Subject: Re:  [4.2 Regression] Gcc 4.2
        miscompiles binutils

On Sun, 2006-04-30 at 18:21 +0000, pinskia at gcc dot gnu dot org wrote:
> 
> ------- Comment #10 from pinskia at gcc dot gnu dot org  2006-04-30 18:21 -------
> Here is the reduced testcase:
> int f(unsigned number_of_digits_to_use)
> {
>   if (number_of_digits_to_use >1294)
>     return 0;
>   return (number_of_digits_to_use * 3321928 / 1000000 + 1) /16;
> }
> 
> int main(void)
> {
>   if (f(11) != 2)
>     __builtin_abort ();
As discussed in the PR, the problem is we don't detect overflow
from MULT_EXPR correctly.  This causes us to get an incorrect
range which ultimately cascades into generating the wrong
return value.

This patch fixes the overflow detection for MULT_EXPR.  Bootstrapped
and regression tested on i686-pc-linux-gnu, both on the 4.1 branch
and mainline.


------- Comment #15 from law at redhat dot com  2006-05-02 19:44 -------
Created an attachment (id=11362)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11362&action=view)


-- 


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


  parent reply	other threads:[~2006-05-02 19:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-30  7:13 [Bug other/27364] New: Gcc 4.2 miscompiles binutils hjl at lucon dot org
2006-04-30  7:14 ` [Bug other/27364] " pinskia at gcc dot gnu dot org
2006-04-30  7:25 ` pinskia at gcc dot gnu dot org
2006-04-30  7:35 ` pinskia at gcc dot gnu dot org
2006-04-30  9:59 ` dirtyepic dot sk at gmail dot com
2006-04-30 14:25 ` hjl at lucon dot org
2006-04-30 15:33 ` hjl at lucon dot org
2006-04-30 15:57 ` pinskia at gcc dot gnu dot org
2006-04-30 17:55 ` hjl at lucon dot org
2006-04-30 18:11 ` hjl at lucon dot org
2006-04-30 18:17 ` [Bug tree-optimization/27364] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-04-30 18:21 ` pinskia at gcc dot gnu dot org
2006-04-30 18:23 ` [Bug tree-optimization/27364] [4.1/4.2 Regression] VRP miscompiles some unsigned math pinskia at gcc dot gnu dot org
2006-04-30 18:24 ` pinskia at gcc dot gnu dot org
2006-04-30 19:45 ` pinskia at gcc dot gnu dot org
2006-05-01 16:36 ` law at redhat dot com
2006-05-02 19:44 ` law at redhat dot com [this message]
2006-05-02 19:44 ` law at gcc dot gnu dot org
2006-05-02 19:54 ` law at gcc dot gnu dot org
2006-05-03  0:49 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060502194402.3761.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).