[Bug java/15525] suggestion to enable cast elimination

2015-10-20 Thread aph at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=15525

Andrew Haley  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |WONTFIX

--- Comment #6 from Andrew Haley  ---
We'll never do this.


[Bug java/15525] suggestion to enable cast elimination

2005-04-30 Thread tromey at gcc dot gnu dot org

--- Additional Comments From tromey at gcc dot gnu dot org  2005-05-01 
00:57 ---
There are a couple more cases where explicit casts can be eliminated.

Code like this will introduce an unneeded cast:

   Object o = something;
   String s = (String) o;

Of course this is the simplest possible case; I don't know whether
this occurs in real code or not.


Another case is rearranging an array:

   Object[] array = something();
   array[0] = array[1];

This will generate a call to check whether the array can hold the
object, due to the special role arrays play in the type system;
for example this is valid but throws an exception at runtime:

   String[] sarray = ...;
   Object[] oarray = sarray;
   oarray[0] = new Integer(5);

... because Integer can't be cast to String.
In the first array example, we know that the check can be
eliminated because the rhs of the assignment comes from the
same array.

Currently we emit calls to _Jv_CheckArrayStore for this situation.
While we could inline it (making the type check explicit and allowing
elimination in the style of the other parts of this PR), size of the generated
code might be a concern.

Sometimes the precise type of an array is known, for instance if it
is the result of a 'new'.  In this case it would be nice to be able
to eliminate even more checks.


-- 


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


[Bug java/15525] suggestion to enable cast elimination

2005-03-08 Thread pinskia at gcc dot gnu dot org


-- 
   What|Removed |Added

 CC||pinskia at gcc dot gnu dot
   ||org
   Last reconfirmed|2004-11-06 19:02:10 |2005-03-09 04:38:34
   date||


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