http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56474
--- Comment #14 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2013-03-06 17:19:42 UTC --- > Note the hacks all boil down to the fact that FEs use signed array > domains but unsigned sizetype TYPE_DOMAIN. The C and C++ FE were > adjusted to use (unsigned) [1, 0] for zero-sized arrays - I believe > the current hacks are all because of Ada (and yes, I invented them > to not need to fiddle with the Ada FE when removing TYPE_IS_SIZETYPE). Exactly, that's my point: all the hacks are there to cope with overflow issues introduced by the removal of TYPE_IS_SIZETYPE. Mine is another small one. > There is still the Ada FE bug I opened that shows that arrays > with [0, USIZETYPE_MAX] vs. [SSIZETYPE_MIN, SSIZETYPE_MAX] do not > work. Independent of any hacks to fix the current error to address > that you need to work to fix the signedness issue (which may of > course require middle-end adjustments). Sure. > If you don't want overflow you can as well re-set TREE_OVERFLOW > on the result ... (just to give another option). That's exactly what the hack at stor-layout.c 2234 does for C and C++!