http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57821
Bug ID: 57821
Summary: 'array is too large' error is missing when sizetype
overflows
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: amylaar at gcc dot gnu.org
Created attachment 30455
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30455&action=edit
test case for 32 bit targets
The overflow check in c-family/c-common.c:complete_array_type relied on
overflows for type sizes being recorded.
Since this patch:
2012-05-10 Richard Guenther <[email protected]>
* tree.h (TYPE_IS_SIZETYPE): Remove.
* fold-const.c (int_const_binop_1): Remove TYPE_IS_SIZETYPE use.
(extract_muldiv_1): Likewise.
* gimple.c (gtc_visit): Likewise.
(gimple_types_compatible_p): Likewise.
(iterative_hash_canonical_type): Likewise.
(gimple_canonical_types_compatible_p): Likewise.
* gimplify.c (gimplify_one_sizepos): Likewise.
* print-tree.c (print_node): Likewise.
we lost the distinction between size types and other types, so
complete_array_type is now on its own if it wants special overflow treatment.
This shows up as regressions for large-size-array-{2,4}.c for targets with
16 bit size_t, but also affects other targets when compiling code with
sufficiently large designators in an array initializer.