aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-06-11 13:58:29 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-06-11 13:58:29 +0000
commit5a20ffcb3afa4c44d0518d30010f002a32a8f7b2 (patch)
tree3d8a83b6c9d132b6dd192eb5f7b028b4fe8e49fc /gcc/cp
parenta95b3cc7342a7a6601bcb8b6ce7be2e46297a7b4 (diff)
downloadgcc-5a20ffcb3afa4c44d0518d30010f002a32a8f7b2.zip
gcc-5a20ffcb3afa4c44d0518d30010f002a32a8f7b2.tar.gz
gcc-5a20ffcb3afa4c44d0518d30010f002a32a8f7b2.tar.bz2
re PR c++/53605 (Compiler ICEs in size_binop_loc)
2012-06-11 Richard Guenther <rguenther@suse.de> PR c++/53616 * mangle.c (write_array_type): Use double-ints for array domain arithmetic. * g++.dg/ext/pr53605.C: New testcase. From-SVN: r188386
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/mangle.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 832ba9e..0b1602a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2012-06-11 Richard Guenther <rguenther@suse.de>
+
+ PR c++/53616
+ * mangle.c (write_array_type): Use double-ints for array domain
+ arithmetic.
+
2012-06-07 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/51214
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index c801848..2ec626c 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -3119,8 +3119,10 @@ write_array_type (const tree type)
{
/* The ABI specifies that we should mangle the number of
elements in the array, not the largest allowed index. */
- max = size_binop (PLUS_EXPR, max, size_one_node);
- write_unsigned_number (tree_low_cst (max, 1));
+ double_int dmax
+ = double_int_add (tree_to_double_int (max), double_int_one);
+ gcc_assert (double_int_fits_in_uhwi_p (dmax));
+ write_unsigned_number (dmax.low);
}
else
{