This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Eliminating Assembler Already Defined Messages for Java Library


(Mark, I'm cc'ing you because your name is attached to ChangeLog
entries that seem related to this problem, and otherwise I'm afraid
you might skip the message.)

kenner@vlsi1.ultra.nyu.edu (Richard Kenner) writes:

>     If you want your patch P reinstalled, please investigate what goes
>     wrong when it is included, fix that problem, and then submit P and the
>     fix.  In the meantime, we can bootstrap.
> 
> I'll be glad to do that and I indeed already offered.  Please show me the
> code that gets miscompiled and we'll see what's going wrong.

The code that gets mis-compiled is the Java run-time library
when you do a bootsrap under ix86 Linux.

I've looked a little more at the problem.  I am willing to believe
it may be a problem in the Java front-end, but I don't really have
a good handle on the problem or how to fix it.

The problem involves a block created by expand_fixup.  This needs
to be inserted somehow into the block structure - but where?
Some complicating factors:

* cfun->x_whole_function_mode_p is not set.  It perhaps should be
(when compiling from source).  However, the Java front-end pre-dates
x_whole_function_mode_p.  Just setting x_whole_function_mode_p = 1
in the front-end seems plausible, but triggers other problems.

* jc1 uses a pun where the BLOCK_SUBBLOCKS field of a block is
used for the BLOCK_EXPR_BODY of a block (i.e. the "body"
expression of a block, typically a OCMPOUND_EXPR).  The BLOCK_EXPR_BODY
is used after parsing and up until expand_expr; BLOCK_SUBBLOCKS field
needs to be correct at final.  I don't know if this is an issue,
but it could be a contributing complicating factor.

It might be cleaner to replace BLOCK with a BIND_EXPR, but it might
be better if we could defer that until after 3.0.

So before we try to hack together a solution, we need to understand
/ agree on some things:

(1) is setting x_whole_function_mode_p to 1 the Right Think to do?

(2) Given that we have a tree of BLOCK nodes created by the front
end, when expand_fixup creates a block, where should it go?  The
code for when cfun->x_whole_function_mode_p is true is this:
	    BLOCK_CHAIN (block)
	      = BLOCK_CHAIN (DECL_INITIAL (current_function_decl));
	    BLOCK_CHAIN (DECL_INITIAL (current_function_decl))
	      = block;
This doesn't work, because DECL_INITIAL hasn't been set yet,
but that can be fixed.  However, my attempts at do so haven't
worked, so far.  If we leave x_whole_function_mode_p false,
then insert_block gets called - and seems to do the wrong thing.
Again, that can probably be fixed - if I knew where the new
block should go.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]