aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/decl.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-11-06 00:01:01 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-11-06 00:01:01 +0000
commitc034b4535845e25b6d4ba62be5bccb86ee7278c6 (patch)
tree2b6700e1b5e792d259ddb86880b95e93c8315f4b /gcc/java/decl.c
parent112615e7d3db8aae00b002543db3ddf94e8e31a2 (diff)
downloadgcc-c034b4535845e25b6d4ba62be5bccb86ee7278c6.zip
gcc-c034b4535845e25b6d4ba62be5bccb86ee7278c6.tar.gz
gcc-c034b4535845e25b6d4ba62be5bccb86ee7278c6.tar.bz2
re PR java/6388 (Integer.MIN_VALUE == 0x80000000 optimized to false on powerpc)
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. From-SVN: r58843
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r--gcc/java/decl.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 4b06aaf..3d3665b 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,20 @@ 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;
+#if HOST_BITS_PER_WIDE_INT == 64
+ decimal_long_max = build_int_2 (0x8000000000000000, 0);
+#else
+#if HOST_BITS_PER_WIDE_INT == 32
+ decimal_long_max = build_int_2 (0, 0x80000000);
+#else
+ #error "unsupported size"
+#endif
+#endif
+ 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);