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

Reply via email to