aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@cygnus.com>1999-10-22 05:27:34 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>1999-10-21 22:27:34 -0700
commit100f7cd8b9ea79bfef97fe723e220711c3e43385 (patch)
treedb668a8231c0e086a62c51a4d6c1e2fdbb0d73b9 /gcc/java
parentd84319deb3c0a19ef89a4208b5c46454f17d55ad (diff)
downloadgcc-100f7cd8b9ea79bfef97fe723e220711c3e43385.zip
gcc-100f7cd8b9ea79bfef97fe723e220711c3e43385.tar.gz
gcc-100f7cd8b9ea79bfef97fe723e220711c3e43385.tar.bz2
re GNATS gcj/37 (gcj fails to compile "jBYTEmark" from source code when optimization is used)
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. (array_constructor_check_entry): Complete an initializer element on permanent_obstack. This patch fixes the net PR #37 (http://sourceware.cygnus.com/ml/java-prs/1999-q3/msg00043.html) From-SVN: r30126
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog8
-rw-r--r--gcc/java/parse.c22
-rw-r--r--gcc/java/parse.y20
3 files changed, 42 insertions, 8 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 6fbe2af..8bbdad3 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,11 @@
+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.
+ (array_constructor_check_entry): Complete an initializer element
+ on permanent_obstack.
+
1999-10-19 Tom Tromey <tromey@cygnus.com>
* jcf-parse.c (parse_source_file): Call jcf_dependency_add_file.
diff --git a/gcc/java/parse.c b/gcc/java/parse.c
index 9cc96f8..863d1ec 100644
--- a/gcc/java/parse.c
+++ b/gcc/java/parse.c
@@ -2388,8 +2388,10 @@ int yydebug; /* nonzero means print parse trace */
/* Prevent warning if -Wstrict-prototypes. */
#ifdef __GNUC__
+#ifndef YYPARSE_PARAM
int yyparse (void);
#endif
+#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
@@ -10613,7 +10615,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;
@@ -10815,8 +10819,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_obstacks ();
+ }
if (!TREE_CONSTANT (cn) && !flag_emit_xref)
{
@@ -11069,7 +11077,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_obstacks ();
if (value != NULL_TREE)
{
tree type = TREE_TYPE (value);
@@ -13456,6 +13468,7 @@ array_constructor_check_entry (type, entry)
new_value = NULL_TREE;
wfl_value = TREE_VALUE (entry);
+ push_obstacks (&permanent_obstack, &permanent_obstack);
value = java_complete_tree (TREE_VALUE (entry));
/* patch_string return error_mark_node if arg is error_mark_node */
if ((patched = patch_string (value)))
@@ -13471,7 +13484,8 @@ array_constructor_check_entry (type, entry)
new_value = try_builtin_assignconv (wfl_operator, type, value);
if (!new_value && (new_value = try_reference_assignconv (type, value)))
type_value = promote_type (type);
-
+
+ pop_obstacks ();
/* Check and report errors */
if (!new_value)
{
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 0459ed3..1fabf80 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -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_obstacks ();
+ }
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_obstacks ();
if (value != NULL_TREE)
{
tree type = TREE_TYPE (value);
@@ -10871,6 +10881,7 @@ array_constructor_check_entry (type, entry)
new_value = NULL_TREE;
wfl_value = TREE_VALUE (entry);
+ push_obstacks (&permanent_obstack, &permanent_obstack);
value = java_complete_tree (TREE_VALUE (entry));
/* patch_string return error_mark_node if arg is error_mark_node */
if ((patched = patch_string (value)))
@@ -10886,7 +10897,8 @@ array_constructor_check_entry (type, entry)
new_value = try_builtin_assignconv (wfl_operator, type, value);
if (!new_value && (new_value = try_reference_assignconv (type, value)))
type_value = promote_type (type);
-
+
+ pop_obstacks ();
/* Check and report errors */
if (!new_value)
{