aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/decl.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2007-12-18 14:06:15 +0000
committerAndrew Haley <aph@gcc.gnu.org>2007-12-18 14:06:15 +0000
commit0741e2aff181cddb7235b45dc3102ebc76815aa3 (patch)
tree9bce766e3768b6f93b5136c4fb071bceb45fa58e /gcc/java/decl.c
parentae0bce62c6dbce0a5bf288b63dc569de8ba657ad (diff)
downloadgcc-0741e2aff181cddb7235b45dc3102ebc76815aa3.zip
gcc-0741e2aff181cddb7235b45dc3102ebc76815aa3.tar.gz
gcc-0741e2aff181cddb7235b45dc3102ebc76815aa3.tar.bz2
re PR java/27643 (ICE in java_mark_cni_decl_local compiling bytecode->native)
2007-12-18 Andrew Haley <aph@redhat.com> PR java/27643 * jcf-parse.c (java_parse_file): Remove call to java_mark_class_local. (parse_class_file): Reinstate call to java_mark_class_local here. * decl.c (java_mark_cni_decl_local): If the ASSEMBLER_NAME is already set, call java_mangle_decl() and make_decl_rtl() to rewrite its name as a hidden alias. From-SVN: r131036
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r--gcc/java/decl.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index d60af8d..1f0dbf4 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -1890,18 +1890,27 @@ java_mark_decl_local (tree decl)
static void
java_mark_cni_decl_local (tree decl)
{
- /* Setting DECL_LOCAL_CNI_METHOD_P changes the behavior of the mangler.
- We expect that we should not yet have referenced this decl in a
- context that requires it. Check this invariant even if we don't have
- support for hidden aliases. */
- gcc_assert (!DECL_ASSEMBLER_NAME_SET_P (decl));
-
#if !defined(HAVE_GAS_HIDDEN) || !defined(ASM_OUTPUT_DEF)
return;
#endif
DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
DECL_LOCAL_CNI_METHOD_P (decl) = 1;
+
+ /* Setting DECL_LOCAL_CNI_METHOD_P changes the behavior of the
+ mangler. We might have already referenced this native method and
+ therefore created its name, but even if we have it won't hurt.
+ We'll just go via its externally visible name, rather than its
+ hidden alias. However, we must force things so that the correct
+ mangling is done. */
+
+ if (DECL_ASSEMBLER_NAME_SET_P (decl))
+ java_mangle_decl (decl);
+ if (DECL_RTL_SET_P (decl))
+ {
+ SET_DECL_RTL (decl, 0);
+ make_decl_rtl (decl);
+ }
}
/* Use the preceding two functions and mark all members of the class. */