Re: gcj: ICE on gcj -c seda.jar

2006-12-04 Thread Andrew Haley
Shaun Jackman writes:
 > $ gcj -c /usr/share/java/seda.jar
 > seda/sandStorm/internal/AggTPSThreadManager.java: In class
 > 'seda.sandStorm.internal.AggTPSThreadManager$governorThread':
 > seda/sandStorm/internal/AggTPSThreadManager.java: In method
 > 'seda.sandStorm.internal.AggTPSThreadManager$governorThread.run()':
 > seda/sandStorm/internal/AggTPSThreadManager.java:328: internal
 > compiler error: Segmentation fault
 > Please submit a full bug report,
 > with preprocessed source if appropriate.
 > See http://gcc.gnu.org/bugs.html> for instructions.
 > For Debian GNU/Linux specific bug reporting instructions,
 > see .
 > 
 > The line the compiler mentions is...
 > $ cat -n ./seda/src/seda/sandStorm/internal/ATTIC/AggTPSThreadManager.java
 > ...
 > 25   package seda.sandStorm.internal;
 > ...
 > 44   class AggTPSThreadManager implements ThreadManagerIF, 
 > sandStormConst {
 > 45   
 > 46 private static final boolean DEBUG = true;
 > 47 private static final boolean DEBUG_VERBOSE = false;
 > ...
 >327   public void run() {
 >328 if (DEBUG) System.err.println("AggTPSTM Governor: 
 > starting");
 >329   
 > ...
 > $ gcj --version |head -1
 > gcj (GCC) 4.1.2 20061020 (prerelease) (Debian 4.1.1-17)
 > 
 > The binary and source files in question may be downloaded from a Debian 
 > archive:
 > http://packages.debian.org/testing/libs/libseda-java

Thanks.  This is caused because
seda.sandStorm.internal.AggTPSThreadManager$governorThread is in the
file
seda/sandStorm/internal/ATTIC/AggTPSThreadManager$governorThread.class
(In other words, it's not where gcj expects to find it.)

This is a bug in gcj.  We probably shouldn't even attempt to generate
code when a class is not in the right place in an archive, and exit
with a compiler error.  

zip -d usr/share/java/seda.jar seda/sandStorm/internal/ATTIC/\*

solves the problem.

Andrew.


PR java/18811 [4.0 Regression] rhug build problem, regression?

2004-12-06 Thread Andrew Haley
Please try this.

Index: gjavah.c
===
RCS file: /cvs/gcc/gcc/gcc/java/gjavah.c,v
retrieving revision 1.124
diff -c -2 -p -r1.124 gjavah.c
*** gjavah.c25 Nov 2004 11:13:37 -  1.124
--- gjavah.c6 Dec 2004 19:15:39 -
*** throwable_p (const unsigned char *clname
*** 1235,1239 
int super_length = -1;
const char *classfile_name = find_class ((char *) current, strlen 
((const char *) current),
!  &jcf, 0);
  
if (! classfile_name)
--- 1235,1239 
int super_length = -1;
const char *classfile_name = find_class ((char *) current, strlen 
((const char *) current),
!  &jcf, 0, 0);
  
if (! classfile_name)
*** main (int argc, char** argv)
*** 2521,2525 
if (! output_file)
jcf_dependency_reset ();
!   classfile_name = find_class (classname, strlen (classname), &jcf, 0);
if (classfile_name == NULL)
{
--- 2521,2525 
if (! output_file)
jcf_dependency_reset ();
!   classfile_name = find_class (classname, strlen (classname), &jcf, 0, 0);
if (classfile_name == NULL)
{
Index: java-tree.h
===
RCS file: /cvs/gcc/gcc/gcc/java/java-tree.h,v
retrieving revision 1.223
diff -c -2 -p -r1.223 java-tree.h
*** java-tree.h 26 Nov 2004 18:04:45 -  1.223
--- java-tree.h 6 Dec 2004 19:15:40 -
*** extern int is_array_type_p (tree);
*** 1248,1251 
--- 1248,1252 
  extern HOST_WIDE_INT java_array_type_length (tree);
  extern int read_class (tree);
+ extern int read_class_from_source (tree);
  extern void load_class (tree, int);
  
Index: jcf-dump.c
===
RCS file: /cvs/gcc/gcc/gcc/java/jcf-dump.c,v
retrieving revision 1.64
diff -c -2 -p -r1.64 jcf-dump.c
*** jcf-dump.c  25 Nov 2004 11:13:38 -  1.64
--- jcf-dump.c  6 Dec 2004 19:15:40 -
*** main (int argc, char** argv)
*** 1036,1040 
{
  char *arg = argv[argi];
! const char *class_filename = find_class (arg, strlen (arg), jcf, 0);
  if (class_filename == NULL)
class_filename = find_classfile (arg, jcf, NULL);
--- 1036,1040 
{
  char *arg = argv[argi];
! const char *class_filename = find_class (arg, strlen (arg), jcf, 0, 
0);
  if (class_filename == NULL)
class_filename = find_classfile (arg, jcf, NULL);
Index: jcf-io.c
===
RCS file: /cvs/gcc/gcc/gcc/java/jcf-io.c,v
retrieving revision 1.53
diff -c -2 -p -r1.53 jcf-io.c
*** jcf-io.c17 Oct 2004 22:51:35 -  1.53
--- jcf-io.c6 Dec 2004 19:15:40 -
*** static htab_t memoized_class_lookups;
*** 422,430 
 to it.  Returns NULL on failure.  If JCF != NULL, it is suitably
 initialized.  SOURCE_OK is true if we should also look for .java
!file. */
  
  const char *
  find_class (const char *classname, int classname_length, JCF *jcf,
!   int source_ok)
  {
int fd;
--- 422,431 
 to it.  Returns NULL on failure.  If JCF != NULL, it is suitably
 initialized.  SOURCE_OK is true if we should also look for .java
!file.  SOURCE_ONLY is true iff we should only look for .java
!files.  */
  
  const char *
  find_class (const char *classname, int classname_length, JCF *jcf,
!   int source_ok, int source_only)
  {
int fd;
*** find_class (const char *classname, int c
*** 464,468 
  {
const char *path_name = jcf_path_name (entry);
!   if (class != 0)
{
  int dir_len;
--- 465,469 
  {
const char *path_name = jcf_path_name (entry);
!   if (class != 0 && ! source_only)
{
  int dir_len;
Index: jcf-parse.c
===
RCS file: /cvs/gcc/gcc/gcc/java/jcf-parse.c,v
retrieving revision 1.180
diff -c -2 -p -r1.180 jcf-parse.c
*** jcf-parse.c 28 Nov 2004 06:49:48 -  1.180
--- jcf-parse.c 6 Dec 2004 19:15:41 -
*** static void set_source_filename (JCF *, 
*** 107,110 
--- 107,111 
  static void jcf_parse (struct JCF*);
  static void load_inner_classes (tree);
+ static int read_class_worker (tree, int);
  
  /* Handle "Deprecated" attribute.  */
*** int
*** 514,517 
--- 515,530 
  read_class (tree name)
  {
+   return read_class_worker (name, 0);
+ }
+ 
+ int
+ read_class_from_source (tree name)
+ {
+   return read_class_worker (name, 1);
+ }
+ 
+ static int
+ read_class_worker (tree name, int source_only)
+ {
JCF this_jcf, *jcf;
tree icv, class = NULL_TREE;
*** read_class (tree name)
*** 534,538 
jcf = &this_jcf;