[Bug middle-end/56474] [4.8 regression] bogus Storage_Error raised for record containing empty zero-based array
rguenther at suse dot de
gcc-bugzilla@gcc.gnu.org
Mon Mar 4 15:45:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56474
--- Comment #10 from rguenther at suse dot de <rguenther at suse dot de> 2013-03-04 15:45:09 UTC ---
On Mon, 4 Mar 2013, ebotcazou at gcc dot gnu.org wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56474
>
> --- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2013-03-04 15:38:53 UTC ---
> > Hm, if hb < lb - what kind of pair do you expect? The only case
> > where lb - 1 is the "upper bound" (whatever upper bound is for an
> > empty array ...) - isn't lb - 1 always equal to hb in that case,
> > thus are not hb and lb one element apart for empty arrays (length == 0)?
>
> No, you can have "superflat" arrays and they need to have zero length (instead
> of a negative one) in Ada, hence the formula.
Btw, it's easy to not get the overflow for this formula by using
fold_build2 instead of size_binop.
More information about the Gcc-bugs
mailing list