public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/28089]  New: jc1 miscompilation with fields inherited from interfaces
@ 2006-06-19 22:42 tromey at gcc dot gnu dot org
  2006-06-20 18:11 ` [Bug java/28089] " tromey at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-06-19 22:42 UTC (permalink / raw)
  To: java-prs

Look at initfield.java or PR162.java from the test suite.
>From initfield:

interface iface
{
  final value x = new value();
}

public class initfield implements iface
{
  public static void main(String[] args)
  {
    System.out.println(x.field);
...


When compiled with a correct java compiler (not gcj)
to bytecode, this line is compiled as:
  0: getstatic #18=<Field java.lang.System.out java.io.PrintStream>
  3: getstatic #24=<Field initfield.x value>
  6: getfield #28=<Field value.field java.lang.Object>
  9: invokevirtual #34=<Method java.io.PrintStream.println
(java.lang.Object)void>

Note at PC=3 how the qualifying class is 'initfield', not 'iface'.

If this class is the run through gcj (using the c++ abi) the resulting
program will crash.

I think the fix is for gcj to notice this situation and emit an
explicit class initialization call for the declaring class of the field.
This conforms to the overall c++ abi idea; for BC we already properly
handle this at runtime.

This is a blocker for ecj integration.


-- 
           Summary: jc1 miscompilation with fields inherited from interfaces
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tromey at gcc dot gnu dot org


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


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

* [Bug java/28089] jc1 miscompilation with fields inherited from interfaces
  2006-06-19 22:42 [Bug java/28089] New: jc1 miscompilation with fields inherited from interfaces tromey at gcc dot gnu dot org
@ 2006-06-20 18:11 ` tromey at gcc dot gnu dot org
  2006-06-21 18:01 ` tromey at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-06-20 18:11 UTC (permalink / raw)
  To: java-prs



-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tromey at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-06-20 18:11:55
               date|                            |


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


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

* [Bug java/28089] jc1 miscompilation with fields inherited from interfaces
  2006-06-19 22:42 [Bug java/28089] New: jc1 miscompilation with fields inherited from interfaces tromey at gcc dot gnu dot org
  2006-06-20 18:11 ` [Bug java/28089] " tromey at gcc dot gnu dot org
@ 2006-06-21 18:01 ` tromey at gcc dot gnu dot org
  2006-06-21 18:14 ` tromey at gcc dot gnu dot org
  2006-09-12 19:41 ` tromey at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-06-21 18:01 UTC (permalink / raw)
  To: java-prs



------- Comment #1 from tromey at gcc dot gnu dot org  2006-06-21 18:01 -------
Subject: Bug 28089

Author: tromey
Date: Wed Jun 21 18:01:37 2006
New Revision: 114856

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114856
Log:
        PR java/28089:
        * expr.c (expand_java_field_op): Initialize field's declaring
        class.

Modified:
    branches/gcj-eclipse/gcc/java/ChangeLog
    branches/gcj-eclipse/gcc/java/expr.c


-- 


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


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

* [Bug java/28089] jc1 miscompilation with fields inherited from interfaces
  2006-06-19 22:42 [Bug java/28089] New: jc1 miscompilation with fields inherited from interfaces tromey at gcc dot gnu dot org
  2006-06-20 18:11 ` [Bug java/28089] " tromey at gcc dot gnu dot org
  2006-06-21 18:01 ` tromey at gcc dot gnu dot org
@ 2006-06-21 18:14 ` tromey at gcc dot gnu dot org
  2006-09-12 19:41 ` tromey at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-06-21 18:14 UTC (permalink / raw)
  To: java-prs



------- Comment #2 from tromey at gcc dot gnu dot org  2006-06-21 18:14 -------
Fix checked in on gcj-eclipse branch.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug java/28089] jc1 miscompilation with fields inherited from interfaces
  2006-06-19 22:42 [Bug java/28089] New: jc1 miscompilation with fields inherited from interfaces tromey at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-06-21 18:14 ` tromey at gcc dot gnu dot org
@ 2006-09-12 19:41 ` tromey at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tromey at gcc dot gnu dot org @ 2006-09-12 19:41 UTC (permalink / raw)
  To: java-prs



------- Comment #3 from tromey at gcc dot gnu dot org  2006-09-12 19:41 -------
Also fixed on trunk; updating target milestone.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.2.0


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


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

end of thread, other threads:[~2006-09-12 19:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-19 22:42 [Bug java/28089] New: jc1 miscompilation with fields inherited from interfaces tromey at gcc dot gnu dot org
2006-06-20 18:11 ` [Bug java/28089] " tromey at gcc dot gnu dot org
2006-06-21 18:01 ` tromey at gcc dot gnu dot org
2006-06-21 18:14 ` tromey at gcc dot gnu dot org
2006-09-12 19:41 ` 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).