public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-21855-360@http.gcc.gnu.org/bugzilla/>]
* [Bug java/21855] New: array bounds checking elimination
@ 2005-06-01  1:55 tromey at gcc dot gnu dot org
  2005-06-01 20:31 ` [Bug tree-optimization/21855] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 26+ messages in thread
From: tromey at gcc dot gnu dot org @ 2005-06-01  1:55 UTC (permalink / raw)
  To: java-prs

public class q
{
  public static void main(String[] args)
  {
    for (int i = 0; i < args.length; ++i)
      System.out.println(args[i]);
  }
}

Right now you will get an unnecessary array bounds check at 'args[i]'.
BTW we implement this check with an unsigned comparison to also weed
out negative indices.

Also, an array's size is fixed at its creation.  We ought to be
able to constant propagate in code like this:

   int[] array = new int[256];
   for (int i = 0; i < array.length; ++i) { ... }

... but afaik there is no way for the front end of the value of
'array.length'

-- 
           Summary: array bounds checking elimination
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: dnovillo at redhat dot com
        ReportedBy: tromey at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


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


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2015-10-20 15:08 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-21855-8172@http.gcc.gnu.org/bugzilla/>
2012-01-10 15:43 ` [Bug tree-optimization/21855] array bounds checking elimination rguenth at gcc dot gnu.org
2012-01-10 15:53 ` aph at gcc dot gnu.org
2012-01-10 16:20 ` [Bug java/21855] " rguenth at gcc dot gnu.org
2012-01-10 16:28 ` aph at gcc dot gnu.org
2012-01-10 16:31 ` rguenth at gcc dot gnu.org
2012-01-10 16:36 ` rguenth at gcc dot gnu.org
2012-01-10 16:46 ` aph at gcc dot gnu.org
2012-01-10 16:58 ` rguenth at gcc dot gnu.org
2012-01-10 16:59 ` rguenth at gcc dot gnu.org
2012-01-10 17:08 ` aph at gcc dot gnu.org
2012-01-10 17:18 ` tromey at gcc dot gnu.org
2012-01-10 17:22 ` tromey at gcc dot gnu.org
2015-10-20 15:08 ` aph at gcc dot gnu.org
     [not found] <bug-21855-360@http.gcc.gnu.org/bugzilla/>
2009-04-03 12:07 ` [Bug tree-optimization/21855] " rguenth at gcc dot gnu dot org
2009-04-03 19:18 ` pinskia at gcc dot gnu dot org
2009-04-08 16:37 ` tromey at gcc dot gnu dot org
2009-04-08 20:33 ` rguenth at gcc dot gnu dot org
2009-04-23 16:15 ` aph at gcc dot gnu dot org
2009-04-23 16:17 ` paolo dot carlini at oracle dot com
2009-04-23 16:23 ` aph at gcc dot gnu dot org
2009-04-23 16:26 ` paolo dot carlini at oracle dot com
2010-07-15 22:43 ` steven at gcc dot gnu dot org
2005-06-01  1:55 [Bug java/21855] New: " tromey at gcc dot gnu dot org
2005-06-01 20:31 ` [Bug tree-optimization/21855] " pinskia at gcc dot gnu dot org
2005-06-03 14:08 ` dnovillo at gcc dot gnu dot org
2005-06-03 14:34 ` dnovillo at gcc dot gnu dot org
2005-06-04 17:00 ` dnovillo at gcc dot gnu dot org

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).