Bug 28090 - incorrect implementation of expand_java_arraystore
Summary: incorrect implementation of expand_java_arraystore
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Tom Tromey
URL:
Keywords: wrong-code
Depends on: 19505
Blocks: 28067
  Show dependency treegraph
 
Reported: 2006-06-19 23:07 UTC by Tom Tromey
Modified: 2007-01-09 20:37 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-06-20 20:22:21


Attachments
proposed patch (645 bytes, patch)
2006-06-20 17:42 UTC, Tom Tromey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2006-06-19 23:07:11 UTC
According to the ArrayStore.java test case, bounds checks should
take precedence over array store checks.  However, expand_java_arraystore
clearly does it in the wrong order:

  if (TREE_CODE (rhs_type_node) == POINTER_TYPE)
    {
      tree check = build_java_arraystore_check (array, rhs_node);
      java_add_stmt (check);
    }
  
  array = build_java_arrayaccess (array, rhs_type_node, index);
Comment 1 Andrew Pinski 2006-06-20 17:37:38 UTC
Confirmed.
Comment 2 Tom Tromey 2006-06-20 17:42:48 UTC
Created attachment 11712 [details]
proposed patch

I've attached a proposed patch.
However, when I use this patch I run into PR 19505.
Comment 3 Tom Tromey 2006-07-18 15:12:53 UTC
FWIW compiling from bytecode on svn head fails as well.
In fact the test case is xfailed in this case.
So this doesn't appear to be a regression.

Also I think this patch is bogus (but at least it shows the
right place to add the fix).
Comment 4 Paolo Bonzini 2006-09-13 10:10:40 UTC
PR19505 is fixed, is the patch still bad?
Comment 5 Andrew Haley 2006-12-21 15:09:19 UTC
I fixed PR19505 in July.  Should not this patch go in?

This is the last bug blocking 28067...
Comment 6 Tom Tromey 2007-01-09 20:37:50 UTC
Andrew's fix for this went in with the merge.