public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ian at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/61308] gccgo: ICE in Expression::check_bounds [GoSmith]
Date: Tue, 05 Aug 2014 02:58:00 -0000	[thread overview]
Message-ID: <bug-61308-4-ldeiL9pI8N@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61308-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61308

--- Comment #4 from ian at gcc dot gnu.org <ian at gcc dot gnu.org> ---
Author: ian
Date: Tue Aug  5 02:58:15 2014
New Revision: 213616

URL: https://gcc.gnu.org/viewcvs?rev=213616&root=gcc&view=rev
Log:
    PR go/61308
    PR go/61866

compiler: Don't cast index expr to int before bounds check.

This fixes http://gcc.gnu.org/PR61866 : on a 32-bit system,
casting an int64 index to int drops the upper 32 bits of the
value, and thus can cause an out-of-range index to appear to
be in range.

This undoes part of change 1318:fa6e0c716dba
(https://codereview.appspot.com/104610044) and therefore
breaks http://gcc.gnu.org/PR61308 again.  I have a separate
patch for that (http://codereview.appspot.com/122020043).  In
addition to undoing part of that change, this patch adds code
to avoid a compiler crash.  This changes PR61308 from a
compiler crash to an incorrect error message.

Modified:
    trunk/gcc/go/gofrontend/expressions.cc


  parent reply	other threads:[~2014-08-05  2:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-25  7:21 [Bug go/61308] New: " dvyukov at google dot com
2014-07-08 21:29 ` [Bug go/61308] " ian at gcc dot gnu.org
2014-07-08 21:39 ` dvyukov at google dot com
2014-08-05  2:51 ` ian at airs dot com
2014-08-05  2:58 ` ian at gcc dot gnu.org [this message]
2014-08-05  3:11 ` ian at gcc dot gnu.org
2014-08-05  3:11 ` ian at gcc dot gnu.org
2014-08-05  3:21 ` ian at airs dot com

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=bug-61308-4-ldeiL9pI8N@http.gcc.gnu.org/bugzilla/ \
    --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).