This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/57821] 'array is too large' error is missing when sizetype overflows


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57821

--- Comment #7 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
(In reply to Chung-Ju Wu from comment #6)

> Check gcc test summary, it shows that the problem only appears on 32-bit
> host.

That's because of the different size of HOST_WIDE_INT.  FWIW, you can
also force that to 64 bit during configure.

The issue arises when you have a 32 bit HOST_WIDE_INT, but a 64 bit
(target) sizetype.
The code that ICEs assumes it's always enough in this context to only use
the low half of an INTREGER_CST tree node.

hwint.h says that HOST_WIDE_INT should be 64 bit when targeting a machine with
64 bit size_t.  You can insure that by setting need_64bit_hwint in
gcc/config.gcc / libcpp/configure.ac .  Although the former has a different
description what it's for.  So either the comment there is lacking, or
the comment in hwint.h just says how to paper over bugs in various (?)
places in the compiler that don't use the highpart of an INTEGER_CST for
what it's for.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]