aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/class.c
diff options
context:
space:
mode:
authorJeff Sturm <jsturm@one-point.com>2002-12-23 19:42:09 +0000
committerJeff Sturm <jsturm@gcc.gnu.org>2002-12-23 19:42:09 +0000
commitd3ab697ba4d1eeeecc4ab37337cbcad455c80057 (patch)
tree8de2de732a2a531c035647c360acaa01a32c9d78 /gcc/java/class.c
parent46d40353c383ea8aa490e88cb43adf1652176985 (diff)
downloadgcc-d3ab697ba4d1eeeecc4ab37337cbcad455c80057.zip
gcc-d3ab697ba4d1eeeecc4ab37337cbcad455c80057.tar.gz
gcc-d3ab697ba4d1eeeecc4ab37337cbcad455c80057.tar.bz2
class.c (build_static_field_ref): Check FIELD_FINAL.
* class.c (build_static_field_ref): Check FIELD_FINAL. * constants.c (alloc_class_constant): Use TYPE_CPOOL_DATA_REF instead of current_constant_pool_data_ref. * java-tree.h (current_constant_pool_data_ref): Undefine. (JTI_CURRENT_CONSTANT_POOL_DATA_REF): Remove. * jcf-parse.c (init_outgoing_cpool): Don't initialize current_constant_pool_data_ref. * except.c (prepare_eh_table_type ): Use DECL_NAME of class type, not build_internal_class_name. * parse.y (patch_incomplete_class_ref): Always emit `class$' method. Use it when class ref isn't certain to be compiled. From-SVN: r60448
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r--gcc/java/class.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c
index f833888..5e5a66e 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -1076,7 +1076,9 @@ build_static_field_ref (fdecl)
{
tree fclass = DECL_CONTEXT (fdecl);
int is_compiled = is_compiled_class (fclass);
- if (is_compiled)
+
+ /* Allow static final fields to fold to a constant. */
+ if (is_compiled || FIELD_FINAL (fdecl))
{
if (!DECL_RTL_SET_P (fdecl))
{