This is the mail archive of the
java-prs@sourceware.cygnus.com
mailing list for the Java project.
Re: gcj/37
- To: apbianco at cygnus dot com
- Subject: Re: gcj/37
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: 20 Oct 1999 22:30:00 -0000
- Cc: java-prs at sourceware dot cygnus dot com,
- Reply-To: Bryce McKinlay <bryce at albatross dot co dot nz>
The following reply was made to PR gcj/37; it has been noted by GNATS.
From: Bryce McKinlay <bryce@albatross.co.nz>
To: Alexandre Petit-Bianco <apbianco@cygnus.com>
Cc: green@cygnus.com, java-gnats@sourceware.cygnus.com
Subject: Re: gcj/37
Date: Thu, 21 Oct 1999 11:23:10 +1300
Alexandre Petit-Bianco wrote:
> Bryce, can you try the following patch on a fairly recent gcj source
> tree, if you have one. Like, one that fixes the qualified expression
> problems people reported this summer but still builds. I can't test
> this patch right now, the source tree seems to be completely broken --
> at least for my Debian box: `genattr' and/or the matching `md' file
> seem to have gone completely south.
Hi,
I applied your patch to yesterday's gcc tree (which compiled okay for me apart
from libstdc++ problems. It compiles libgcj fine)
Before the patch it compiles jbytemark from .class with -O3, and from .java with
-O2 (but not -O3). After applying the patch it still crashes with -O3, but only
on one file.
Here's a backtrace (after applying patch)
(gdb) run EMFloatTest.java -fno-use-divide-subroutine -quiet -O3 -version -o
/tmp/ccIiOMva.s
Starting program: /usr/local/egcs/lib/gcc-lib/i686-pc-linux-gnu/2.96/jc1
EMFloatTest.java -fno-use-divide-subroutine -quiet -O3 -version -o
/tmp/ccIiOMva.s
GNU Java version 2.96 19991019 (experimental) (i686-pc-linux-gnu) compiled by
GNU C version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release).
Program received signal SIGSEGV, Segmentation fault.
0x80c78a6 in output_constant (exp=0x82aeb4c, size=1) at ../../gcc/varasm.c:4014
4014 register enum tree_code code = TREE_CODE (TREE_TYPE (exp));
(gdb) bt
#0 0x80c78a6 in output_constant (exp=0x82aeb4c, size=1) at
../../gcc/varasm.c:4014
#1 0x80c7d21 in output_constructor (exp=0x8274f3c, size=16) at
../../gcc/varasm.c:4274
#2 0x80c7a3c in output_constant (exp=0x8274f3c, size=16) at
../../gcc/varasm.c:4104
#3 0x80c4ea4 in assemble_variable (decl=0x82b1268, top_level=1, at_end=1,
dont_output_data=0) at ../../gcc/varasm.c:1650
#4 0x8078a78 in rest_of_decl_compilation (decl=0x82b1268, asmspec=0x0,
top_level=1,
at_end=1) at ../../gcc/toplev.c:3491
#5 0x8077905 in wrapup_global_declarations (vec=0xbffff964, len=61)
at ../../gcc/toplev.c:2688
#6 0x8078438 in compile_file (name=0xbffffc50 "EMFloatTest.java")
at ../../gcc/toplev.c:3240
#7 0x807b4fc in main (argc=8, argv=0xbffffae4) at ../../gcc/toplev.c:5552
BTW: "pop_obstack ()" should be "pop_obstacks ()" I presume?
> ./A
>
> Wed Oct 20 01:41:47 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
>
> * parse.y (java_complete_tree): fold_constant_for_init to work
> on permanent_obstack.
> (java_complete_lhs): Likewise.
>
> Index: parse.y
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
> retrieving revision 1.112
> diff -u -p -r1.112 parse.y
> --- parse.y 1999/10/14 17:13:56 1.112
> +++ parse.y 1999/10/20 08:42:31
> @@ -8028,7 +8028,9 @@ java_complete_tree (node)
> {
> tree value = DECL_INITIAL (node);
> DECL_INITIAL (node) = NULL_TREE;
> + push_obstacks (&permanent_obstack, &permanent_obstack);
> value = fold_constant_for_init (value, node);
> + pop_obstacks ();
> DECL_INITIAL (node) = value;
> if (value != NULL_TREE)
> return value;
> @@ -8230,8 +8232,12 @@ java_complete_lhs (node)
> && JDECL_P (TREE_OPERAND (cn, 1))
> && FIELD_FINAL (TREE_OPERAND (cn, 1))
> && DECL_INITIAL (TREE_OPERAND (cn, 1)))
> - cn = fold_constant_for_init (DECL_INITIAL (TREE_OPERAND (cn, 1)),
> - TREE_OPERAND (cn, 1));
> + {
> + push_obstacks (&permanent_obstack, &permanent_obstack);
> + cn = fold_constant_for_init (DECL_INITIAL (TREE_OPERAND (cn, 1)),
> + TREE_OPERAND (cn, 1));
> + pop_obstack ();
> + }
>
> if (!TREE_CONSTANT (cn) && !flag_emit_xref)
> {
> @@ -8484,7 +8490,11 @@ java_complete_lhs (node)
> && TREE_CODE (nn) == VAR_DECL && TREE_STATIC (nn)
> && DECL_INITIAL (nn) != NULL_TREE)
> {
> - tree value = fold_constant_for_init (nn, nn);
> + tree value;
> +
> + push_obstacks (&permanent_obstack, &permanent_obstack);
> + value = fold_constant_for_init (nn, nn);
> + pop_obstack ();
> if (value != NULL_TREE)
> {
> tree type = TREE_TYPE (value);