[Bug libfortran/33298] Wrong code for SPREAD on zero-sized arrays

toon at moene dot indiv dot nluug dot nl gcc-bugzilla@gcc.gnu.org
Thu Sep 6 08:56:00 GMT 2007



------- Comment #8 from toon at moene dot indiv dot nluug dot nl  2007-09-06 08:56 -------
Wouldn't it be an option to simply bail out early (i.e., after the error
checks) in case of size == 0 ?

E.g., like this:

     62
     63   rrank = srank + 1;
     64   if (rrank > GFC_MAX_DIMENSIONS)
     65     runtime_error ("return rank too large in spread()");
     66
     67   if (*along > rrank)
     68       runtime_error ("dim outside of rank in spread()");

          if (size == 0)
            return

Or do we actually have to set something on return ?


-- 


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



More information about the Gcc-bugs mailing list