]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/53605 (Compiler ICEs in size_binop_loc)
authorRichard Guenther <rguenther@suse.de>
Mon, 11 Jun 2012 13:58:29 +0000 (13:58 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 11 Jun 2012 13:58:29 +0000 (13:58 +0000)
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

gcc/cp/ChangeLog
gcc/cp/mangle.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/pr53605.C [new file with mode: 0644]

index 832ba9eac43e7cc60e15144fb7d8bc1011f50065..0b1602a7892b7cb9426382b1e68f1e10b89171cb 100644 (file)
@@ -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
index c8018483b81c0f2c80aabcd344766403905fe0ec..2ec626c9d5dc9a68f98f9f131788e9f1475a3266 100644 (file)
@@ -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
        {
index bab237880702831bf1cbe37ef958103fbae87246..baa04c04ad2223792bf7b646b24a0a17affb53ce 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        * gnat.dg/specs/array1.ads: New test.
diff --git a/gcc/testsuite/g++.dg/ext/pr53605.C b/gcc/testsuite/g++.dg/ext/pr53605.C
new file mode 100644 (file)
index 0000000..0b902dd
--- /dev/null
@@ -0,0 +1,16 @@
+// { 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");
+}
This page took 0.196807 seconds and 5 git commands to generate.