Bug 12548 - [3.4 Regression] [non-weak] gcj now failes to compile included example
Summary: [3.4 Regression] [non-weak] gcj now failes to compile included example
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 3.4.0
: P2 critical
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
: 12858 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-09 10:10 UTC by oyvind.harboe
Modified: 2004-01-17 04:22 UTC (History)
2 users (show)

See Also:
Host: windows
Target: windows
Build: windows
Known to work:
Known to fail:
Last reconfirmed: 2003-10-31 16:36:29


Attachments
Contains example case (937.97 KB, application/x-zip-compressed)
2003-10-09 10:10 UTC, oyvind.harboe
Details
I stripped away as much as I could from this jar while retaining the reproducable test case (82.24 KB, application/x-zip-compressed)
2003-11-19 11:09 UTC, oyvind.harboe
Details
Narrowing in on the problem (1.96 KB, application/x-zip-compressed)
2003-11-19 14:16 UTC, oyvind.harboe
Details
Test case boiled down to a single trivial class (875 bytes, application/x-zip-compressed)
2003-11-19 14:21 UTC, oyvind.harboe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description oyvind.harboe 2003-10-09 10:10:00 UTC
This works w/GCJ 3.3

Attaching test case.

Øyvind



[Output deleted]

org/eclipse/swt/custom/WrappedContent.java:155: warning: unreachable bytecode fr
om 138 to before 141
c:\temp/cc4obaaa.s: Assembler messages:
c:\temp/cc4obaaa.s:1090314: Error: symbol `__GLOBAL__I__ZN3org6apache6regexp31Ch
aracterArrayCharacterIterator6class$E' is already defined
Comment 1 oyvind.harboe 2003-10-09 10:10:54 UTC
Created attachment 4903 [details]
Contains example case
Comment 2 Andrew Pinski 2003-10-09 15:12:19 UTC
I can reproduce this in the mainline (20031007) on powerpc-apple-darwin7.0 so this is a generic 
bug.
Comment 3 Bryce McKinlay 2003-10-10 00:24:01 UTC
Could not reproduce with gcc 3.4 20030930 on linux x86 native, so the bug may have been 
introduced since then.
Comment 4 Andrew Pinski 2003-10-10 00:43:21 UTC
Note both Darwin and cygwin do not support weak symbols so it might be related to that.
Comment 5 Andrew Pinski 2003-10-11 17:59:43 UTC
Might be fixed by:
	* varasm.c (notice_global_symbol):  Fix handling of variables; avoid
	re-computing of variable.

Can you try again, I would but I am tracking down another bug?
Comment 6 oyvind.harboe 2003-10-13 09:59:01 UTC
Compiling GCC isn't my forte.

I tried to compile GCC 3.4 from CVS, but it failed today:


/home/oyvind/gcc/gcc/gcc/config/i386/gthr-win32.c:74: warning: no previous
prototype for `__gthr_win32_once'
/home/oyvind/gcc/gcc/gcc/config/i386/gthr-win32.c:105: warning: no previous
prototype for `__gthr_win32_key_create'
/home/oyvind/gcc/gcc/gcc/config/i386/gthr-win32.c:124: warning: no previous
prototype for `__gthr_win32_key_delete'
/home/oyvind/gcc/gcc/gcc/config/i386/gthr-win32.c:130: warning: no previous
prototype for `__gthr_win32_getspecific'
/home/oyvind/gcc/gcc/gcc/config/i386/gthr-win32.c:141: warning: no previous
prototype for `__gthr_win32_setspecific'
/home/oyvind/gcc/gcc/gcc/config/i386/gthr-win32.c:147: warning: no previous
prototype for `__gthr_win32_mutex_init_function'
/home/oyvind/gcc/gcc/gcc/config/i386/gthr-win32.c:154: warning: no previous
prototype for `__gthr_win32_mutex_lock'
/home/oyvind/gcc/gcc/gcc/config/i386/gthr-win32.c:163: warning: no previous
prototype for `__gthr_win32_mutex_trylock'
/home/oyvind/gcc/gcc/gcc/config/i386/gthr-win32.c:172: warning: no previous
prototype for `__gthr_win32_mutex_unlock'
m
Comment 7 Andrew Pinski 2003-10-31 15:31:09 UTC
*** Bug 12858 has been marked as a duplicate of this bug. ***
Comment 8 oyvind.harboe 2003-10-31 16:22:37 UTC
>Might be fixed by:
>	* varasm.c (notice_global_symbol):  Fix handling of variables; avoid
>	re-computing of variable.
>
>Can you try again, I would but I am tracking down another bug?

I guess it still happens, since the bug I reported was marked as a duplicate of 
this one and that was a freshly compiled GCC 3.4 from CVS as of today.

Bug 12858 - marked as duplicate
Øyvind
Comment 9 Andrew Haley 2003-11-11 15:01:19 UTC
I can't duplicate this on Linux.

Please use -save-temps and let me have the .s file.
Comment 10 Andrew Pinski 2003-11-11 16:03:25 UTC
I should say this has to be with no weak symbols in the target like powerpc-apple-darwin and 
i686-pc-cygwin.
Comment 11 Andrew Pinski 2003-11-11 16:03:59 UTC
I should say this has to be with no weak symbols in the target like powerpc-apple-darwin and 
i686-pc-cygwin.  Also this is really a middle-end problem.
Comment 12 oyvind.harboe 2003-11-11 17:48:07 UTC
This is strangerer, and strangerer.

When I add the -save-temps argument I get no error message.

And probably an invalid output. the .s file is too big to attach to this bug-
report.


Although I have used two different computers(the main difference being 256MB 
vs. 512MB ram) for testing against this problem, I have a sneaking suspicion 
that this compile takes way longer than normal.



C:\temp\testgcc34>\wingcc\bin\gcj -save-temps  -c -fjni -o libs.o modified_swt.j
ar jakarta-regexp-1.2.jar

C:\temp\testgcc34>dir
 Volume in drive C has no label.
 Volume Serial Number is 78B4-9509

 Directory of C:\temp\testgcc34

11.11.2003  18:41       <DIR>          .
11.11.2003  18:41       <DIR>          ..
11.11.2003  18:41           27 314 131 ccimaaaajx.s
11.11.2003  18:18                   87 compile.cmd
20.12.2002  16:24               29 053 jakarta-regexp-1.2.jar
11.11.2003  18:41                  288 libs.o
01.07.2003  08:48            1 001 678 modified_swt.jar
               5 File(s)     28 345 237 bytes
               2 Dir(s)  19 183 005 696 bytes free

C:\temp\testgcc34>zip -r temps *.s
  adding: ccimaaaajx.s (deflated 89%)

Comment 13 oyvind.harboe 2003-11-12 12:51:38 UTC
I verified that the same problem happens with my Linux -> Windows cross 
compiler, so at least the problem should be debuggable on Linux.

My Linux->Windows cross compiler is built per Mohans instructions.

Øyvind
Comment 14 Bryce McKinlay 2003-11-16 01:23:24 UTC
Has anyone been able to figure out roughly when this regression was introduced? It would be 
useful to know what patch caused it.
Comment 15 oyvind.harboe 2003-11-19 11:09:25 UTC
Created attachment 5167 [details]
I stripped away as much as I could from this jar while retaining the reproducable test case




Command line:

\wingcc\bin\gcj   -c -fjni -o libs.o modified_swt.jar

Output:
c:\temp/ccsJaaaa.s: Assembler messages:
c:\temp/ccsJaaaa.s:116134: Error: symbol
`__GLOBAL__I__ZN3org7eclipse3swt8graphi
cs5ColorC1Ev' is already defined
Comment 16 oyvind.harboe 2003-11-19 14:16:48 UTC
Created attachment 5173 [details]
Narrowing in on the problem

C:\Temp\foo>\wingcc\bin\gcj -o xxx.o -fjni -c test.jar
c:\temp/cc6Haaaa.s: Assembler messages:
c:\temp/cc6Haaaa.s:1005: Error: symbol
`__GLOBAL__I__ZN3org7eclipse3swt8SWTError
C1EiPN4java4lang6StringE' is already defined
Comment 17 oyvind.harboe 2003-11-19 14:21:48 UTC
Created attachment 5174 [details]
Test case boiled down to a single trivial class

C:\Temp\foo>\wingcc\bin\gcj -o xxx.o -fjni -c test.jar
c:\temp/ccMHaaaa.s: Assembler messages:
c:\temp/ccMHaaaa.s:235: Error: symbol
`__GLOBAL__I__ZN3FooC1EiPN4java4lang6Strin
gE' is already defined


The source:

public class Foo extends Error {
	public int code;
	public Throwable throwable;

public Foo (int code, String message) {
	super (message);
	this.code = code;
}
}
Comment 18 oyvind.harboe 2003-11-19 14:22:40 UTC
If I unzip Foo.class and compile it, I do not get an error.

C:\Temp\foo>unzip test.jar
Archive:  test.jar
replace META-INF/MANIFEST.MF? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: META-INF/MANIFEST.MF
  inflating: Foo.class
  inflating: .classpath
  inflating: .project

C:\Temp\foo>\wingcc\bin\gcj -o xxx.o -fjni -c Foo.class
Comment 19 oyvind.harboe 2003-11-19 14:24:26 UTC
Ah!

The problem seems to be files in the jar which start with "." 



C:\Temp\foo>\wingcc\bin\gcj -o xxx.o -fjni -c test.jar
c:\temp/cceAaaaa.s: Assembler messages:
c:\temp/cceAaaaa.s:235: Error: symbol `__GLOBAL__I__ZN3FooC1EiPN4java4lang6Strin
gE' is already defined

C:\Temp\foo>zip -d test.jar .*
deleting: .classpath
deleting: .project

C:\Temp\foo>\wingcc\bin\gcj -o xxx.o -fjni -c test.jar

C:\Temp\foo>
Comment 20 Rutger Ovidius 2003-11-19 21:30:49 UTC
This is boot.jar from Eclipse 3.0M4:

http://download.berlios.de/pub/mldonkey/z/boot.jar

This is gcc 3.4 (win32): gcc version 3.4 20031109 (experimental)

gcj -c boot.jar -o boot.o 

C:\DOCUME~1\Main\LOCALS~1\Temp/ccUFdaaa.s: Assembler messages:
C:\DOCUME~1\Main\LOCALS~1\Temp/ccUFdaaa.s:94423: Error: symbol 
`__GLOBAL__I__ZN3org7eclipse4core4boot10BootLoader18__U3c_clinit__U3e_Ev' is
already defined

Works fine with 3.3.1.  There are no .* files in boot.jar that I can see.
Comment 21 GCC Commits 2003-11-26 01:34:35 UTC
Subject: Bug 12548

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	membar@gcc.gnu.org	2003-11-26 01:34:32

Modified files:
	gcc/java       : ChangeLog resource.c 

Log message:
	PR java/12548
	* resource.c (write_resource_constructor): Append
	"_resource" to constructor identifier name.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1300&r2=1.1301
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/resource.c.diff?cvsroot=gcc&r1=1.8&r2=1.9

Comment 22 Andrew Pinski 2003-11-26 01:56:17 UTC
Fixed for 3.4.