https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69368
--- Comment #17 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #16) > (In reply to Dominique d'Humieres from comment #14) > > > But I guess even this doesn't help, while it will help poor man's flexible > > > array members in C/C++, in this Fortran case the problem is that there is > > > COMMON /FMCOM/ X(1) > > > in this TU, while > > > COMMON /FMCOM / X(1000000) > > > in some other TU, and get_ref_base_and_extent caps maxsize at > > > DECL_SIZE - bit_offset (which is generally right, but Fortran COMMON > > > is just weird). > > > > This invalid Fortran. > > Yes, but this is SPEC2k6, so we need some workaround or workaround option or > something for that I'm afraid. No, tonto had this same crap and we required patching it. That said, all users of get_ref_base_and_extent are effected here (SRA, FRE, PRE, DSE), so this isn't sth new - it's just that now we catch this as well after loop opts did enough massaging to the IL to expose it. > > > So, perhaps we want some flag on the Fortran COMMON decls that would be > > > set on COMMON that ends with an array and would tell > > > get_ref_base_and_extent > > > (and other spots?) that accesses can be beyond end of the decl? > > > > Related to/ duplicate of pr44882?