Commit 5a20ffcb by Richard Guenther Committed by Richard Biener

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
parent a95b3cc7
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 Chne <fabien@gcc.gnu.org> 2012-06-07 Fabien Chne <fabien@gcc.gnu.org>
PR c++/51214 PR c++/51214
......
...@@ -3119,8 +3119,10 @@ write_array_type (const tree type) ...@@ -3119,8 +3119,10 @@ write_array_type (const tree type)
{ {
/* The ABI specifies that we should mangle the number of /* The ABI specifies that we should mangle the number of
elements in the array, not the largest allowed index. */ elements in the array, not the largest allowed index. */
max = size_binop (PLUS_EXPR, max, size_one_node); double_int dmax
write_unsigned_number (tree_low_cst (max, 1)); = 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 else
{ {
......
2012-06-11 Richard Guenther <rguenther@suse.de>
PR c++/53616
* g++.dg/ext/pr53605.C: New testcase.
2012-06-11 Eric Botcazou <ebotcazou@adacore.com> 2012-06-11 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/specs/array1.ads: New test. * gnat.dg/specs/array1.ads: New test.
......
// { dg-do compile }
// Avoid -pedantic-error default
// { dg-options "" }
template <bool lhs_is_null_literal>
class EqHelper {
public:
template <typename T1, typename T2>
static int Compare( const T1& expected,
const T2& actual);
};
void foo(){
static const int kData[] = {};
::EqHelper<false>::Compare(kData, "abc");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment