aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2008-04-08 08:46:04 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-04-08 08:46:04 +0200
commitf9a4f2ef03bc9ad213e82e40b4c26fc0d33b1a94 (patch)
tree1b1ef712806bd0b0506e27898f6b8a70596ba394
parent682bca235fc640470bfadbf75d93f10d0ccdeb77 (diff)
downloadgcc-f9a4f2ef03bc9ad213e82e40b4c26fc0d33b1a94.zip
gcc-f9a4f2ef03bc9ad213e82e40b4c26fc0d33b1a94.tar.gz
gcc-f9a4f2ef03bc9ad213e82e40b4c26fc0d33b1a94.tar.bz2
re PR target/10768 (ICEs on compilation of ada support library for avr)
2008-04-08 Tristan Gingold <gingold@adacore.com> PR ada/10768 * cuintp.c: Fix 16 bits issue for AVR. On AVR, integer is 16 bits, so it can't be used to do math with Base (=32768). So use long_integer instead. From-SVN: r134013
-rw-r--r--gcc/ada/cuintp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ada/cuintp.c b/gcc/ada/cuintp.c
index ba3ffa0..90ea342 100644
--- a/gcc/ada/cuintp.c
+++ b/gcc/ada/cuintp.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2007, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2008, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -101,11 +101,15 @@ UI_To_gnu (Uint Input, tree type)
large as an integer not to overflow. REAL types are always fine, but
INTEGER or ENUMERAL types we are handed may be too short. We use a
base integer type node for the computations in this case and will
- convert the final result back to the incoming type later on. */
+ convert the final result back to the incoming type later on.
+ The base integer precision must be superior than 16. */
if (TREE_CODE (comp_type) != REAL_TYPE
- && TYPE_PRECISION (comp_type) < TYPE_PRECISION (integer_type_node))
- comp_type = integer_type_node;
+ && TYPE_PRECISION (comp_type) < TYPE_PRECISION (long_integer_type_node))
+ {
+ comp_type = long_integer_type_node;
+ gcc_assert (TYPE_PRECISION (comp_type) > 16);
+ }
gnu_base = build_cst_from_int (comp_type, Base);