This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A buglet


I've found what I think is an interesting optimization bug.

Try this:

Index: Array_3.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.lang/Array_3.java,v
retrieving revision 1.1
diff -p -2 -c -r1.1 Array_3.java
*** Array_3.java	20 Dec 2001 14:09:03 -0000	1.1
--- Array_3.java	27 Jun 2002 18:24:31 -0000
*************** public class Array_3
*** 20,24 ****
      try
        {
! 	int[] x = (int[])foo();
  	nn = x.length;
        }
--- 20,24 ----
      try
        {
! 	int[] x = (int[])null;
  	nn = x.length;
        }

I get a test failure at -O1.  It looks like the null pointer access is
being removed by the optimizer.  Of course, -fcheck-references fixes
things.

Can someone please try this so I know it's not a problem with my
setup?  This is from the trunk.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]