public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* Static array length access bug in gcj
@ 2000-04-01  0:00 Anand Krishnaswamy
  2000-04-01  0:00 ` Tom Tromey
  2000-04-01  0:00 ` Jeff Sturm
  0 siblings, 2 replies; 4+ messages in thread
From: Anand Krishnaswamy @ 2000-04-01  0:00 UTC (permalink / raw)
  To: 'java-discuss@sourceware.cygnus.com'

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]

Title: Static array length access bug in gcj





Hello:


I get a compiler error when I try the following. Any ideas?
Anand


::::::::::::::
A.java
::::::::::::::
public class A {
   public static String[] strArr = { "A", "B", "C" };
}
::::::::::::::
B.java
::::::::::::::
import java.lang.*;
import java.util.*;


public class B {
   public static void main ( String[] args ) {
        int length = A.strArr.length;
        System.out.println ( "Array length: " + length );
   }
}


$ gcj --main=B A.java B.java
B.java:6: Internal compiler error:
B.java:6: Internal compiler error in `expand_expr', at expr.c:5750
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.


[anandkr@crchy0n9 test]$ gcj -v
Reading specs from /opt/lib/gcc-lib/powerpc-unknown-linux-gnu/2.95.1/specs
Reading specs from /opt/lib/libgcj.spec
rename spec lib to liborig
gcc version 2.95.1 19990816 (release)


Anand Krishnaswamy
Wireless Solutions, e-mobility HLR
Phone: (972) 684-7414 or ESN 444-7414
Fax    : (972) 684-3739 or ESN 444-3739
E-mail : anandkr@nortelnetworks.com




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

* Re: Static array length access bug in gcj
  2000-04-01  0:00 Static array length access bug in gcj Anand Krishnaswamy
@ 2000-04-01  0:00 ` Tom Tromey
  2000-04-01  0:00 ` Jeff Sturm
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Anand Krishnaswamy; +Cc: 'java-discuss@sourceware.cygnus.com'

>>>>> "Anand" == Anand Krishnaswamy <anandkr@nortelnetworks.com> writes:

Anand> I get a compiler error when I try the following. Any ideas?

I get the same problem.
Can you submit a PR to the Java Gnats database?

http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?user=guest&password=guest&database=java&cmd=login

Thanks,
Tom

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

* Re: Static array length access bug in gcj
  2000-04-01  0:00 Static array length access bug in gcj Anand Krishnaswamy
  2000-04-01  0:00 ` Tom Tromey
@ 2000-04-01  0:00 ` Jeff Sturm
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Sturm @ 2000-04-01  0:00 UTC (permalink / raw)
  To: Anand Krishnaswamy; +Cc: 'java-discuss@sourceware.cygnus.com'

Anand Krishnaswamy wrote:
> public class B {
>    public static void main ( String[] args ) {
>         int length = A.strArr.length;

Gcj still has trouble parsing ambiguous expressions like above (it has
to decide if A is a class or package name).  It will compile if you
decompose the complex expression:

          String[] array = A.strArr;
          int length = array.length;

I reproduced this bug with a recent snapshot.  I still don't see it
mentioned in gnats however.  Can you file a bug report?

http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl

-- 
Jeff Sturm
jsturm@sigma6.com

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

* RE: Static array length access bug in gcj
@ 2000-04-01  0:00 Anand Krishnaswamy
  0 siblings, 0 replies; 4+ messages in thread
From: Anand Krishnaswamy @ 2000-04-01  0:00 UTC (permalink / raw)
  To: 'Jeff Sturm'; +Cc: 'java-discuss@sourceware.cygnus.com'

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]

Title: RE: Static array length access bug in gcj





Thanks for the workaround. It works fine for my needs. I did file the bug report and here's the information:
        Thank you very much for your problem report.
        It has the internal identification `gcj/129'.
        The individual assigned to look at your
        report is: apbianco. 


        >Category:       gcj
        >Responsible:    apbianco
        >Synopsis:       Static array length access bug in gcj
        >Arrival-Date:   Fri Jan 07 12:20:00 PST 2000


Anand

-----Original Message-----
From:   Jeff Sturm [SMTP:jsturm@sigma6.com]
Sent:   Friday, January 07, 2000 2:51 PM
To:     Krishnaswamy, Anand [RICH2:2K25:EXCH]
Cc:     'java-discuss@sourceware.cygnus.com'
Subject:        Re: Static array length access bug in gcj


Anand Krishnaswamy wrote:
> public class B {
>    public static void main ( String[] args ) {
>         int length = A.strArr.length;


Gcj still has trouble parsing ambiguous expressions like above (it has
to decide if A is a class or package name).  It will compile if you
decompose the complex expression:


          String[] array = A.strArr;
          int length = array.length;


I reproduced this bug with a recent snapshot.  I still don't see it
mentioned in gnats however.  Can you file a bug report?


http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl


-- 
Jeff Sturm
jsturm@sigma6.com




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

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-01  0:00 Static array length access bug in gcj Anand Krishnaswamy
2000-04-01  0:00 ` Tom Tromey
2000-04-01  0:00 ` Jeff Sturm
  -- strict thread matches above, loose matches on Subject: below --
2000-04-01  0:00 Anand Krishnaswamy

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