aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/decl.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-11-02 21:26:28 +0000
committerTom Tromey <tromey@redhat.com>2002-11-02 21:26:28 +0000
commit283f52518395c1f884f766d482c1b4035fe8c4be (patch)
tree964e6dc1d69e5682362f38b13eb1d4903e32a5cd /gcc/java/decl.c
parent1cc384c9cca937902d25a3a24e2ca8cab6699f3f (diff)
Fix for PR java/6388.
* lex.h (JAVA_INTEGRAL_RANGE_ERROR): Wrap in do...while. * java-tree.h (enum java_tree_index): New values JTI_DECIMAL_INT_MAX_NODE, JTI_DECIMAL_LONG_MAX_NODE. (decimal_int_max, decimal_long_max): New defines. * lex.c (yylex): Rewrote range checking. Sign extend literals. (error_if_numeric_overflow): Rewrote range checking. * decl.c (java_init_decl_processing): Initialize decimal_int_max, decimal_long_max. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@58755 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r--gcc/java/decl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 4b06aaf7d65..172a9fda264 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -1,6 +1,6 @@
/* Process declarations and variables for the GNU compiler for the
Java(TM) language.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -454,6 +454,14 @@ java_init_decl_processing ()
integer_four_node = build_int_2 (4, 0);
integer_minus_one_node = build_int_2 (-1, -1);
+ /* A few values used for range checking in the lexer. */
+ decimal_int_max = build_int_2 (0x80000000, 0);
+ TREE_TYPE (decimal_int_max) = unsigned_int_type_node;
+ decimal_long_max = (HOST_BITS_PER_WIDE_INT == 32
+ ? build_int_2 (0, 0x80000000)
+ : build_int_2 (0x8000000000000000, 0));
+ TREE_TYPE (decimal_long_max) = unsigned_long_type_node;
+
size_zero_node = size_int (0);
size_one_node = size_int (1);
bitsize_zero_node = bitsize_int (0);