public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcj/27101]  New: GCJ rejects valid code (for Sun's measure of "valid')
@ 2006-04-10 13:55 vnasardinov at gmail dot com
  2006-04-10 16:30 ` [Bug java/27101] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vnasardinov at gmail dot com @ 2006-04-10 13:55 UTC (permalink / raw)
  To: java-prs

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

This is probably a duplicate of something that has been filed before,
but my cursory search failed to turn up any similar tickets.

GCJ rejects code that both Sun and Eclipse compilers accept.

Here's the test case:

| $ cat Reluctant.java
| public class Reluctant {
|     private Reluctant internalInstance = new Reluctant();
|
|     public Reluctant() throws Exception {
|         throw new Exception("I'm not coming out");
|     }
|
|     public static void main(String[] args) {
|         try {
|             Reluctant b = new Reluctant();
|             System.out.println("Surprise!");
|         } catch (Exception ex) {
|             System.out.println("I told you so");
|         }
|     }
| }

The test comes from
http://www.javapuzzlers.com/java-puzzlers.zip


Here's what I'm using

| $ gcj -v
| Using built-in specs.
| Reading specs from /usr/lib/gcc/x86_64-redhat-linux/4.1.0/libgcj.spec
| rename spec lib to liborig
| Target: x86_64-redhat-linux
| Configured with: ../configure --prefix=/usr --mandir=/usr/share/man \
|  --infodir=/usr/share/info --enable-shared --enable-threads=posix \
|  --enable-checking=release --with-system-zlib --enable-__cxa_atexit \
|  --disable-libunwind-exceptions --enable-libgcj-multifile \
|  --enable-languages=c,c++,objc,obj-c++,java,fortran,ada \
|  --enable-java-awt=gtk --disable-dssi \
|  --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre \
|  --with-cpu=generic --host=x86_64-redhat-linux
|
| Thread model: posix
| gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)

Here's the compilation error the above code triggers:

| $ gcj -C Reluctant.java
| Reluctant.java: In class 'Reluctant':
| Reluctant.java: In method 'finit$()':
| Reluctant.java:2: error: Exception ^[$-1òøjava.lang.Exceptionòù can't be
thrown in initializer.
|     private Reluctant internalInstance = new Reluctant();
|                                                 ^
| 1 error

Here's what the Eclipse compiler has to say:

| $ ecj -v
| Eclipse Java Compiler v_585_R31x, 3.1.2 release, Copyright IBM Corp 2000,
2006. All rights reserved.
| $ ecj Reluctant.java
| ----------
| 1. WARNING in Reluctant.java
|  (at line 2)
|       private Reluctant internalInstance = new Reluctant();
|                         ^^^^^^^^^^^^^^^^
| The field Reluctant.internalInstance is never read locally
| ----------
| ----------
| 2. WARNING in Reluctant.java
|  (at line 10)
|       Reluctant b = new Reluctant();
|                 ^
| The local variable b is never read
| ----------
| 2 problems (2 warnings)

No errors.

Same with Sun's javac:

| $ javac -version 2>&1 | head -n1
| javac 1.5.0_06
| $ javac -Xlint Reluctant.java
| $ echo $?
| 0


-- 
           Summary: GCJ rejects valid code (for Sun's measure of "valid')
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vnasardinov at gmail dot com


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


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

* [Bug java/27101] GCJ rejects valid code (for Sun's measure of "valid')
  2006-04-10 13:55 [Bug libgcj/27101] New: GCJ rejects valid code (for Sun's measure of "valid') vnasardinov at gmail dot com
@ 2006-04-10 16:30 ` pinskia at gcc dot gnu dot org
  2006-04-10 18:12 ` vnasardinov at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-10 16:30 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-04-10 16:30 -------
Please next time if you going to put the testcase inline don't put stuff in
front of the testcase so it can be easy to access.


Anyways confirmed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|libgcj                      |java
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
   Last reconfirmed|0000-00-00 00:00:00         |2006-04-10 16:30:38
               date|                            |


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


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

* [Bug java/27101] GCJ rejects valid code (for Sun's measure of "valid')
  2006-04-10 13:55 [Bug libgcj/27101] New: GCJ rejects valid code (for Sun's measure of "valid') vnasardinov at gmail dot com
  2006-04-10 16:30 ` [Bug java/27101] " pinskia at gcc dot gnu dot org
@ 2006-04-10 18:12 ` vnasardinov at gmail dot com
  2006-04-10 18:24 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vnasardinov at gmail dot com @ 2006-04-10 18:12 UTC (permalink / raw)
  To: java-prs



------- Comment #2 from vnasardinov at gmail dot com  2006-04-10 18:12 -------
Tom Fitzsimmons stopped complaining about my pipe-quoting technique
after I told him about "M-x delete-rectangle" a.k.a. "C-x r d".  Takes
about 5 seconds in Emacs to fix this up. One, if you type really fast :)

Thanks for looking at this.


-- 


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


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

* [Bug java/27101] GCJ rejects valid code (for Sun's measure of "valid')
  2006-04-10 13:55 [Bug libgcj/27101] New: GCJ rejects valid code (for Sun's measure of "valid') vnasardinov at gmail dot com
  2006-04-10 16:30 ` [Bug java/27101] " pinskia at gcc dot gnu dot org
  2006-04-10 18:12 ` vnasardinov at gmail dot com
@ 2006-04-10 18:24 ` pinskia at gcc dot gnu dot org
  2006-04-12 17:38 ` tromey at gcc dot gnu dot org
  2007-01-09 20:53 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-04-10 18:24 UTC (permalink / raw)
  To: java-prs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-04-10 18:24 -------
(In reply to comment #2)
> Tom Fitzsimmons stopped complaining about my pipe-quoting technique
> after I told him about "M-x delete-rectangle" a.k.a. "C-x r d".  Takes
> about 5 seconds in Emacs to fix this up. One, if you type really fast :)
> Thanks for looking at this.

Who uses emacs, I am serious, I don't.


-- 


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


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

* [Bug java/27101] GCJ rejects valid code (for Sun's measure of "valid')
  2006-04-10 13:55 [Bug libgcj/27101] New: GCJ rejects valid code (for Sun's measure of "valid') vnasardinov at gmail dot com
                   ` (2 preceding siblings ...)
  2006-04-10 18:24 ` pinskia at gcc dot gnu dot org
@ 2006-04-12 17:38 ` tromey at gcc dot gnu dot org
  2007-01-09 20:53 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-04-12 17:38 UTC (permalink / raw)
  To: java-prs



------- Comment #4 from tromey at gcc dot gnu dot org  2006-04-12 17:38 -------
I thought this looked like a dup, but I can't find the original.
In any case, ISTR looking at the logic here in gcj at one point,
and finding that it was all screwed up.

Pinski: you can do:  sed 's/^.//d' > File.java  and then cut
and paste...


-- 


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


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

* [Bug java/27101] GCJ rejects valid code (for Sun's measure of "valid')
  2006-04-10 13:55 [Bug libgcj/27101] New: GCJ rejects valid code (for Sun's measure of "valid') vnasardinov at gmail dot com
                   ` (3 preceding siblings ...)
  2006-04-12 17:38 ` tromey at gcc dot gnu dot org
@ 2007-01-09 20:53 ` tromey at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-01-09 20:53 UTC (permalink / raw)
  To: java-prs



------- Comment #5 from tromey at gcc dot gnu dot org  2007-01-09 20:48 -------
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.
Thanks.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-01-09 20:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-10 13:55 [Bug libgcj/27101] New: GCJ rejects valid code (for Sun's measure of "valid') vnasardinov at gmail dot com
2006-04-10 16:30 ` [Bug java/27101] " pinskia at gcc dot gnu dot org
2006-04-10 18:12 ` vnasardinov at gmail dot com
2006-04-10 18:24 ` pinskia at gcc dot gnu dot org
2006-04-12 17:38 ` tromey at gcc dot gnu dot org
2007-01-09 20:53 ` tromey 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).