* [Bug c++/53752] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
@ 2012-06-23 8:22 ` dcb314 at hotmail dot com
2012-06-23 13:45 ` hjl.tools at gmail dot com
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: dcb314 at hotmail dot com @ 2012-06-23 8:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
--- Comment #1 from dcb <dcb314 at hotmail dot com> 2012-06-23 08:22:17 UTC ---
Created attachment 27689
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27689
gzipped C++ source code
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
2012-06-23 8:22 ` [Bug c++/53752] " dcb314 at hotmail dot com
@ 2012-06-23 13:45 ` hjl.tools at gmail dot com
2012-06-25 8:02 ` [Bug c++/53752] [4.8 Regression] " rguenth at gcc dot gnu.org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2012-06-23 13:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-06-23
CC| |rguenth at gcc dot gnu.org
Target Milestone|--- |4.8.0
Ever Confirmed|0 |1
--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2012-06-23 13:44:53 UTC ---
It is caused by revision 188386:
http://gcc.gnu.org/ml/gcc-cvs/2012-06/msg00296.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] [4.8 Regression] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
2012-06-23 8:22 ` [Bug c++/53752] " dcb314 at hotmail dot com
2012-06-23 13:45 ` hjl.tools at gmail dot com
@ 2012-06-25 8:02 ` rguenth at gcc dot gnu.org
2012-06-25 8:45 ` rguenth at gcc dot gnu.org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-25 8:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Known to work| |4.7.1
AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org
|gnu.org |
Summary|ice in write_array_type |[4.8 Regression] ice in
| |write_array_type
--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-25 08:01:19 UTC ---
Mine. Interestingly enough works on the 4.7 branch (which has the same patch).
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] [4.8 Regression] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
` (2 preceding siblings ...)
2012-06-25 8:02 ` [Bug c++/53752] [4.8 Regression] " rguenth at gcc dot gnu.org
@ 2012-06-25 8:45 ` rguenth at gcc dot gnu.org
2012-06-25 8:50 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-25 8:45 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-25 08:44:35 UTC ---
Created attachment 27698
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27698
autoreduced testcase
We mangle an array with TYPE_DOMAIN [0, UINT_MAX], so it has UINT_MAX + 1
number
of elements. The old code read
/* 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));
which of course simply truncated the result to zero, and only the verifying
that it fits into an unsigned host-wide-int.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] [4.8 Regression] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
` (3 preceding siblings ...)
2012-06-25 8:45 ` rguenth at gcc dot gnu.org
@ 2012-06-25 8:50 ` rguenth at gcc dot gnu.org
2012-06-25 17:36 ` jason at gcc dot gnu.org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-25 8:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-25 08:49:30 UTC ---
Jason - is that what is expected? Or should we have rejected the array
before? I suppose a value of zero is unused (apart from for the GNU extension
of array[0]). But array[0] and array[ULONG_MAX] would mangle the same.
Patch that restores previous behavior:
Index: gcc/cp/mangle.c
===================================================================
--- gcc/cp/mangle.c (revision 188927)
+++ gcc/cp/mangle.c (working copy)
@@ -3121,6 +3121,9 @@ write_array_type (const tree type)
elements in the array, not the largest allowed index. */
double_int dmax
= double_int_add (tree_to_double_int (max), double_int_one);
+ /* Truncate the result - this will mangle [0, SIZE_INT_MAX]
+ number of elements as zero. */
+ dmax = double_int_zext (dmax, TYPE_PRECISION (TREE_TYPE (max)));
gcc_assert (double_int_fits_in_uhwi_p (dmax));
write_unsigned_number (dmax.low);
}
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] [4.8 Regression] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
` (4 preceding siblings ...)
2012-06-25 8:50 ` rguenth at gcc dot gnu.org
@ 2012-06-25 17:36 ` jason at gcc dot gnu.org
2012-06-26 13:55 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu.org @ 2012-06-25 17:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-25 17:36:18 UTC ---
(In reply to comment #4)
> We mangle an array with TYPE_DOMAIN [0, UINT_MAX], so it has UINT_MAX + 1
> number of elements.
Well, since that's how we represent an array of length 0, we need to mangle it
as 0. This testcase isn't creating an array of length UINT_MAX+1, it's
creating an array of length 0.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] [4.8 Regression] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
` (5 preceding siblings ...)
2012-06-25 17:36 ` jason at gcc dot gnu.org
@ 2012-06-26 13:55 ` rguenth at gcc dot gnu.org
2012-06-26 14:03 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-26 13:55 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-26 13:55:39 UTC ---
Author: rguenth
Date: Tue Jun 26 13:55:34 2012
New Revision: 188986
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188986
Log:
2012-06-26 Richard Guenther <rguenther@suse.de>
PR c++/53752
* mangle.c (write_array_type): Truncate the number-of-elements
result.
* g++.dg/torture/pr53752.C: New testcase.
Added:
trunk/gcc/testsuite/g++.dg/torture/pr53752.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/mangle.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] [4.8 Regression] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
` (6 preceding siblings ...)
2012-06-26 13:55 ` rguenth at gcc dot gnu.org
@ 2012-06-26 14:03 ` rguenth at gcc dot gnu.org
2012-06-26 14:03 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-26 14:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-26 14:03:06 UTC ---
Author: rguenth
Date: Tue Jun 26 14:03:02 2012
New Revision: 188987
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188987
Log:
2012-06-26 Richard Guenther <rguenther@suse.de>
PR c++/53752
* mangle.c (write_array_type): Truncate the number-of-elements
result.
* g++.dg/torture/pr53752.C: New testcase.
Added:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/torture/pr53752.C
Modified:
branches/gcc-4_7-branch/gcc/cp/mangle.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-26 14:03:27 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] [4.8 Regression] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
` (7 preceding siblings ...)
2012-06-26 14:03 ` rguenth at gcc dot gnu.org
@ 2012-06-26 14:03 ` rguenth at gcc dot gnu.org
2012-06-26 14:04 ` rguenth at gcc dot gnu.org
2012-11-27 21:50 ` paolo.carlini at oracle dot com
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-26 14:03 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-26 14:03:06 UTC ---
Author: rguenth
Date: Tue Jun 26 14:03:02 2012
New Revision: 188987
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188987
Log:
2012-06-26 Richard Guenther <rguenther@suse.de>
PR c++/53752
* mangle.c (write_array_type): Truncate the number-of-elements
result.
* g++.dg/torture/pr53752.C: New testcase.
Added:
branches/gcc-4_7-branch/gcc/testsuite/g++.dg/torture/pr53752.C
Modified:
branches/gcc-4_7-branch/gcc/cp/mangle.c
branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] [4.8 Regression] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
` (8 preceding siblings ...)
2012-06-26 14:03 ` rguenth at gcc dot gnu.org
@ 2012-06-26 14:04 ` rguenth at gcc dot gnu.org
2012-11-27 21:50 ` paolo.carlini at oracle dot com
10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-26 14:04 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #9 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-26 14:03:27 UTC ---
Fixed.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/53752] [4.8 Regression] ice in write_array_type
2012-06-23 8:20 [Bug c++/53752] New: ice in write_array_type dcb314 at hotmail dot com
` (9 preceding siblings ...)
2012-06-26 14:04 ` rguenth at gcc dot gnu.org
@ 2012-11-27 21:50 ` paolo.carlini at oracle dot com
10 siblings, 0 replies; 12+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-11-27 21:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53752
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jasongross9+bugzilla at
| |gmail dot com
--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-11-27 21:50:30 UTC ---
*** Bug 55495 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 12+ messages in thread