[Bug fortran/60370] TRANSPOSE on rhs of allocatable array assignment gives error with -fcheck=bounds

janus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 3 12:47:00 GMT 2014


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

--- Comment #5 from janus at gcc dot gnu.org ---
(In reply to Mikael Morin from comment #4)
> This patch doesn't work, so it may not be a code ordering issue after all.

I think it *is* an ordering issue after all, and indeed your patch seems to fix
that in the sense that it makes sure that the bounds of 'b' are set before the
bounds-checking code is run.

However, it also seems to introduce another ordering issue: In particular the
bounds of 'b' are now set as

        b.dim[1].lbound = 1;
        b.dim[1].ubound = (D.2352 - D.2351) + 1;

before those temps are actually set via

      D.2351 = a.dim[0].lbound;
      D.2352 = a.dim[0].ubound;



More information about the Gcc-bugs mailing list