User account creation filtered due to spam.

Bug 13964 - jc1 crash when compiling class with circular definitions
Summary: jc1 crash when compiling class with circular definitions
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.0.0
: P2 minor
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on: 28067
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-01 21:01 UTC by Guilhem Lavaux
Modified: 2007-01-09 20:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.0.0
Last reconfirmed: 2004-05-23 17:37:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guilhem Lavaux 2004-02-01 21:01:06 UTC
If you try to compile these two interfaces using 'gcj -c V.java V2.java', you
will obtain a compiler crash. The crash does not happen when you first compile
using 'gcj -C' and then 'gcc -c'. So the presence of the class files should
prevent it as it may be showed by compiling the class using another compiler.

The crash is already present in gcc 3.3.1 and suspected in gcc 3.4.0 (though not
tested) because it's always present in gcc-cvs (head).

public interface V {
        int a = V2.b;
}

public interface V2 {
        int b = V.a;
}
Comment 1 Andrew Pinski 2004-02-01 21:25:14 UTC
Confirmed, the problem is that GCJ is trying fold the final int:
#10 0x0806ffa4 in fold_constant_for_init (node=0x4004c460, context=0x400ca2f4) at parse.y:
16075#11 0x08070504 in maybe_build_class_init_for_field (decl=0x1, expr=0x400ca2f4) at 
parse.y:15945#12 0x0806ed60 in resolve_field_access (qual_wfl=0x4004c300, 
field_decl=0xbf7ee328, field_type=0x0) at parse.y:9488#13 0x0806ffbb in fold_constant_for_init 
(node=0x4004c300, context=0x400c29b4) at parse.y:16077#14 0x08070504 in 
maybe_build_class_init_for_field (decl=0x1, expr=0x400c29b4) at parse.y:15945#15 0x0806ed60 
in resolve_field_access (qual_wfl=0x4004c460, field_decl=0xbf7ee428, field_type=0x0) at parse.y:
9488#16 0x0806ffbb in fold_constant_for_init (node=0x4004c460, context=0x400ca2f4) at 
parse.y:16077#17 0x08070504 in maybe_build_class_init_for_field (decl=0x1, expr=0x400ca2f4) 
at parse.y:15945#18 0x0806ed60 in resolve_field_access (qual_wfl=0x4004c300, 
field_decl=0xbf7ee528, field_type=0x0) at parse.y:9488#19 0x0806ffbb in fold_constant_for_init 
(node=0x4004c300, context=0x400c29b4) at parse.y:16077
Comment 2 Tom Tromey 2007-01-09 20:46:04 UTC
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.