public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/31169] Bootstrap comparison error at revision 122821
Date: Fri, 30 Mar 2007 09:01:00 -0000	[thread overview]
Message-ID: <20070330090119.6764.qmail@sourceware.org> (raw)
In-Reply-To: <bug-31169-276@http.gcc.gnu.org/bugzilla/>



------- Comment #37 from rguenth at gcc dot gnu dot org  2007-03-30 10:01 -------
The (target) difference seems to be that I get (on x86_64)

  mask_lo_45 = 0x0ffffffffffffffff >> D.33492_44;

with a value range of [0,64] for D.33492_44 and a resulting value range of
[0, +INF] for mask_lo_45, not [+INF, +INF] (which is wrong).

Note that I get the same correct behavior iff changing HWI to 32/64bits and
using -m32.  This is the testcase I'm looking at:

#define HOST_WIDE_INT long
#define HOST_BITS_PER_WIDE_INT (8*8)

int
sign_bit_p (int width, HOST_WIDE_INT val_hi, unsigned HOST_WIDE_INT val_lo)
{
  unsigned HOST_WIDE_INT mask_lo, lo;
  HOST_WIDE_INT mask_hi, hi;

  if (width > HOST_BITS_PER_WIDE_INT)
    {
      hi = (unsigned HOST_WIDE_INT) 1 << (width - HOST_BITS_PER_WIDE_INT - 1);
      lo = 0;

      mask_hi = ((unsigned HOST_WIDE_INT) -1
                 >> (2 * HOST_BITS_PER_WIDE_INT - width));
      mask_lo = -1;
    }
  else
    {
      hi = 0;
      lo = (unsigned HOST_WIDE_INT) 1 << (width - 1);

      mask_hi = 0;
      mask_lo = ((unsigned HOST_WIDE_INT) -1
                 >> (HOST_BITS_PER_WIDE_INT - width));
    }

  if ((val_hi & mask_hi) == hi
      && (val_lo & mask_lo) == lo)
    return 1;

  return 0;
}

can you confirm that this one is miscompiled?  I'll try to build a cross
compiler now.


-- 


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


  parent reply	other threads:[~2007-03-30  9:01 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-14  2:59 [Bug tree-optimization/31169] New: " danglin at gcc dot gnu dot org
2007-03-14 20:03 ` [Bug tree-optimization/31169] " sje at cup dot hp dot com
2007-03-14 20:53 ` rguenth at gcc dot gnu dot org
2007-03-14 22:34 ` daney at gcc dot gnu dot org
2007-03-15  0:19 ` sje at cup dot hp dot com
2007-03-15  9:46 ` rguenth at gcc dot gnu dot org
2007-03-15 16:45 ` steven at gcc dot gnu dot org
2007-03-15 16:53 ` sje at cup dot hp dot com
2007-03-15 16:56 ` sje at cup dot hp dot com
2007-03-15 16:56 ` sje at cup dot hp dot com
2007-03-15 16:58 ` sje at cup dot hp dot com
2007-03-15 17:20 ` rguenth at gcc dot gnu dot org
2007-03-15 17:28 ` rguenth at gcc dot gnu dot org
2007-03-15 17:57 ` rguenth at gcc dot gnu dot org
2007-03-15 19:27 ` sje at cup dot hp dot com
2007-03-15 20:59 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-15 21:06 ` rguenth at gcc dot gnu dot org
2007-03-15 21:12 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-16  2:07 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-16  9:26 ` rguenth at gcc dot gnu dot org
2007-03-16 14:44 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-17 13:44 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-17 14:12 ` ghazi at gcc dot gnu dot org
2007-03-17 18:03 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-18  1:56 ` daney at gcc dot gnu dot org
2007-03-19  0:08 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-19  9:56 ` rguenth at gcc dot gnu dot org
2007-03-19 11:08 ` rguenth at gcc dot gnu dot org
2007-03-19 16:11 ` sje at cup dot hp dot com
2007-03-19 16:41 ` ghazi at gcc dot gnu dot org
2007-03-19 22:41 ` sje at cup dot hp dot com
2007-03-20 21:14 ` sje at cup dot hp dot com
2007-03-27 23:58 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-28  7:52 ` rguenth at gcc dot gnu dot org
2007-03-29 16:31 ` rth at gcc dot gnu dot org
2007-03-29 17:13 ` rth at gcc dot gnu dot org
2007-03-29 17:21 ` rth at gcc dot gnu dot org
2007-03-30  8:18 ` rguenth at gcc dot gnu dot org
2007-03-30  9:01 ` rguenth at gcc dot gnu dot org [this message]
2007-03-30  9:16 ` rguenth at gcc dot gnu dot org
2007-03-30  9:47 ` rguenth at gcc dot gnu dot org
2007-03-30 15:15 ` rth at gcc dot gnu dot org
2007-03-30 16:31 ` rth at gcc dot gnu dot org
2007-03-31  0:17 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-31 10:28 ` rguenth at gcc dot gnu dot org
2007-03-31 14:11 ` dave at hiauly1 dot hia dot nrc dot ca
2007-03-31 14:13 ` rguenth at gcc dot gnu dot org
2007-03-31 14:38 ` dave at hiauly1 dot hia dot nrc dot ca
2007-04-01  7:30 ` daney at gcc dot gnu dot org
2007-04-01 18:18 ` rth at gcc dot gnu dot org
2007-04-01 18:26 ` rth at gcc dot gnu dot org
2007-04-12  9:21 ` rguenth 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=20070330090119.6764.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).