This is the mail archive of the java-discuss@sources.redhat.com mailing list for the Java project.


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

Re: -O2 failure with new ABI patches


Alexandre Petit-Bianco wrote:
> > Yes.  Somehow -O2 drops the entire array initializer, causing an
> > unreferenced symbol.
> 
> And this time AG's patch didn't disapear.

It was Mark Mitchell's 1/10 patch:

http://gcc.gnu.org/ml/gcc-patches/2001-01/msg00798.html

Mark writes:
> In addition, toplevel-ness is something that can be directly observed
> from the DECL: the variable is file-scoped if and only if it has a
> NULL DECL_CONTEXT.

Since we can't pass top_level to make_decl_rtl anymore, it guesses '0' from
DECL_CONTEXT and generates a new label, effectively clearing
TREE_SYMBOL_REFERENCED.

(I tried -fkeep-static-consts as a workaround, but I don't think that flags
works as advertised... guess I should post a bug.)

Do you think this patch is correct?  I'm bootstrapping now...

Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.95
diff -u -p -r1.95 expr.c
--- expr.c      2001/01/14 21:48:10     1.95
+++ expr.c      2001/01/16 19:03:46
@@ -2387,8 +2387,8 @@ java_lang_expand_expr (exp, target, tmod
            DECL_INITIAL (init_decl) = value;
            DECL_IGNORED_P (init_decl) = 1;
            TREE_READONLY (init_decl) = 1;
-           TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (init_decl)) = 1;
            make_decl_rtl (init_decl, NULL);
+           TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (init_decl)) = 1;
            init = build1 (ADDR_EXPR, TREE_TYPE (exp), init_decl);
            r = expand_expr (init, target, tmode, modifier);
            return r;
@@ -2410,8 +2410,8 @@ java_lang_expand_expr (exp, target, tmod
            DECL_INITIAL (init_decl) = init;
            DECL_IGNORED_P (init_decl) = 1;
            TREE_READONLY (init_decl) = 1;
-           TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (init_decl)) = 1;
            make_decl_rtl (init_decl, NULL);
+           TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (init_decl)) = 1;
            init = init_decl;
          }
        expand_assignment (build (COMPONENT_REF, TREE_TYPE (data_fld),

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