This is the mail archive of the gcc-patches@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]

Re: [Patch, fortran] PR29451 - Fortran runtime error: Attempt to allocate a negative amount of memory...]


Looking further, I find that

 print *, ubound (soda, 1), ubound (soda, 2)
 print *, ubound (soda)

outputs on the first call to the procedure:

          0           2
          0           0

So, I think something is not right with the vector version of ubound for this case.

Since I am convinced that this patch is doing the right thing, I have replaced

if (.not.any(lbound (soda) <= ubound (soda))) call abort ()

with what should be the equivalent

 if ((lbound (soda, 1) > ubound (soda, 1)) .and. &
     (lbound (soda, 2) > ubound (soda, 2))) call abort ()

As far as you open a PR so that we don't loose track of this problem, I'm fine with that.


FX



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