aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog11
-rw-r--r--gcc/java/lex.c11
-rw-r--r--gcc/java/parse.h4
3 files changed, 19 insertions, 7 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 1c0f9d4..4489f6a 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,7 +1,14 @@
+2004-08-19 Nathan Sidwell <nathan@codesourcery.com>
+
+ * parse.h (JAVA_RADIX10_FLAG): Rename to ...
+ (JAVA_NOT_RADIX10_FLAG): ... here. Invert meaning.
+ * lex.c (do_java_lex): Adjust.
+ (error_if_numeric_overflow): Likewise.
+
2004-08-18 Andrew Pinski <apinski@apple.com>
- * class.c (make_local_function_alias): Only make a new decl if we support
- alias attribute on all decls.
+ * class.c (make_local_function_alias): Only make a new decl if we
+ support alias attribute on all decls.
2004-08-18 Bryce McKinlay <mckinlay@redhat.com>
diff --git a/gcc/java/lex.c b/gcc/java/lex.c
index 5467d60..7c497bd 100644
--- a/gcc/java/lex.c
+++ b/gcc/java/lex.c
@@ -1303,9 +1303,14 @@ do_java_lex (YYSTYPE *java_lval)
value = build_int_cst (long_suffix ? long_type_node : int_type_node,
low, high);
value = force_fit_type (value, 0, false, false);
- SET_LVAL_NODE (value);
+
+ if (radix != 10)
+ {
+ value = copy_node (value);
+ JAVA_NOT_RADIX10_FLAG (value) = 1;
+ }
- JAVA_RADIX10_FLAG (value) = radix == 10;
+ SET_LVAL_NODE (value);
#endif
return INT_LIT_TK;
}
@@ -1733,7 +1738,7 @@ static void
error_if_numeric_overflow (tree value)
{
if (TREE_CODE (value) == INTEGER_CST
- && JAVA_RADIX10_FLAG (value)
+ && !JAVA_NOT_RADIX10_FLAG (value)
&& tree_int_cst_sgn (value) < 0)
{
if (TREE_TYPE (value) == long_type_node)
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index c873b85..9e4e0f8 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -910,9 +910,9 @@ struct parser_ctxt GTY(()) {
TREE_PURPOSE (CPC_INSTANCE_INITIALIZER_LIST (C)) = (S);
/* This is used by the lexer to communicate with the parser. It is
- set on an integer constant if the radix is 10, so that the parser
+ set on an integer constant if the radix is NOT 10, so that the parser
can correctly diagnose a numeric overflow. */
-#define JAVA_RADIX10_FLAG(NODE) TREE_LANG_FLAG_0(NODE)
+#define JAVA_NOT_RADIX10_FLAG(NODE) TREE_LANG_FLAG_0(NODE)
#ifndef JC1_LITE
void java_complete_class (void);